Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/ci-main-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ on:
required: false
type: boolean
default: true
run-bundle-install: # Added to support projects without committed Gemfile.lock (e.g., chef-cli)
description: 'Run bundle install before scanning to generate Gemfile.lock at runtime'
required: false
type: boolean
default: false
udf1:
description: 'User defined flag 1'
required: false
Expand Down Expand Up @@ -727,15 +732,20 @@ jobs:
# - name: Build for Ruby binary
# simple bundle install to generate gemlock(puts them in directory vendor/bundle, and uses actual gemspec for deployment to get multi-architecture ), then build gem
# https://bundler.io/man/bundle-install.1.html
- name: Set up Ruby # Fixed: Ruby setup was missing, causing "bundle: command not found" errors
if: ${{ inputs.language == 'ruby' && inputs.build-profile == 'cli' }}
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
- name: 'Ruby build'
if: ${{ inputs.language == 'ruby' && inputs.build-profile == 'cli' }}
run: |
mkdir -p vendor
if [ -f "Gemfile.lock" ]; then
bundle install --deployment
else
echo "No .gemlock file found, creating it now"
bundle install --path vendor/bundle --deployment
echo "No Gemfile.lock found, creating it now"
bundle install --path vendor/bundle # Fixed: Removed --deployment flag when lockfile doesn't exist
fi
bundle exec rake build

Expand Down Expand Up @@ -1281,7 +1291,7 @@ jobs:
generate-sbom:
name: 'Generating SBOM'
if: ${{ inputs.generate-sbom == true }}
uses: chef/common-github-actions/.github/workflows/sbom.yml@main
uses: chef/common-github-actions/.github/workflows/sbom.yml@nikhil/create-lock-file-runtime
needs: ci-build
secrets: inherit
with:
Expand All @@ -1294,6 +1304,7 @@ jobs:
generate-msft-sbom: ${{ inputs.generate-msft-sbom }}
license_scout: ${{ inputs.license_scout }}
go-private-modules: ${{ inputs.go-private-modules }}
run-bundle-install: ${{ inputs.run-bundle-install }} # Passed to sbom.yml to generate Gemfile.lock at runtime

quality-dashboard:
name: 'Reporting to quality dashboard'
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/sbom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ on:
go-private-modules:
required: false
type: string
run-bundle-install:
description: 'Run bundle install before scanning to generate Gemfile.lock at runtime'
required: false
type: boolean
default: false

env:
# Set the default SBOM filename prefix
Expand Down Expand Up @@ -190,6 +195,13 @@ jobs:
- name: Checkout source
uses: actions/checkout@v6

- name: Set up Ruby and run bundle install
if: ${{ inputs.run-bundle-install == true }}
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true

- name: Configure git for private Go modules
env:
GOPRIVATE: ${{ inputs.go-private-modules }}
Expand Down