Skip to content

Commit bb104ae

Browse files
authored
Merge pull request #50 from chef/nikhil/bundle-install-grype-scan
Added config to run bundle install in grype scan if run-bundle-install is set to true
2 parents 805747b + 61b4df6 commit bb104ae

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/ci-main-pull-request.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ on:
487487
required: false
488488
type: boolean
489489
default: false
490-
run-bundle-install: # Added to support projects without committed Gemfile.lock (e.g., chef-cli)
490+
run-bundle-install:
491491
description: 'Run bundle install before scanning to generate Gemfile.lock at runtime'
492492
required: false
493493
type: boolean
@@ -888,6 +888,20 @@ jobs:
888888
with:
889889
fetch-depth: 0
890890

891+
- name: Set up Ruby
892+
if: ${{ inputs.language == 'ruby' && inputs.run-bundle-install == true }}
893+
uses: ruby/setup-ruby@v1
894+
with:
895+
ruby-version: '3.4'
896+
bundler-cache: false
897+
898+
- name: Run bundle install to generate Gemfile.lock
899+
if: ${{ inputs.language == 'ruby' && inputs.run-bundle-install == true }}
900+
run: |
901+
echo "Generating Gemfile.lock for Grype scan..."
902+
bundle install
903+
echo "Gemfile.lock generated successfully"
904+
891905
- name: Determine severity threshold
892906
id: severity
893907
run: |

0 commit comments

Comments
 (0)