|
359 | 359 | required: false |
360 | 360 | type: string |
361 | 361 | default: 'path/to/detect' |
| 362 | + run-bundle-install: # Added to support projects without committed Gemfile.lock (e.g., chef-cli) |
| 363 | + description: 'Run bundle install before scanning to generate Gemfile.lock at runtime' |
| 364 | + required: false |
| 365 | + type: boolean |
| 366 | + default: false |
362 | 367 |
|
363 | 368 | udf1: |
364 | 369 | description: 'User defined flag 1' |
@@ -764,21 +769,25 @@ jobs: |
764 | 769 | # run: echo 'hello world' |
765 | 770 | # # cargo build --release --target-dir ./bin |
766 | 771 |
|
767 | | - # - name: Build for Ruby binary |
768 | | - # 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 |
769 | | - # https://bundler.io/man/bundle-install.1.html |
| 772 | + # - name: Build for Ruby binary |
| 773 | + # 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 |
| 774 | + # https://bundler.io/man/bundle-install.1.html |
| 775 | + - name: Set up Ruby # Fixed: Ruby setup was missing, causing "bundle: command not found" errors |
| 776 | + if: ${{ inputs.language == 'ruby' && inputs.build-profile == 'cli' }} |
| 777 | + uses: ruby/setup-ruby@v1 |
| 778 | + with: |
| 779 | + ruby-version: '3.4' |
770 | 780 | - name: 'Ruby build' |
771 | 781 | if: ${{ inputs.language == 'ruby' && inputs.build-profile == 'cli' }} |
772 | 782 | run: | |
773 | | - echo "Ruby bundle here" |
774 | | - # mkdir -p vendor |
775 | | - # if [ -f "Gemfile.lock" ]; then |
776 | | - # bundle install --deployment |
777 | | - # else |
778 | | - # echo "No .gemlock file found, creating it now" |
779 | | - # bundle install --path vendor/bundle --deployment |
780 | | - # fi |
781 | | - # bundle exec rake build |
| 783 | + mkdir -p vendor |
| 784 | + if [ -f "Gemfile.lock" ]; then |
| 785 | + bundle install --deployment |
| 786 | + else |
| 787 | + echo "No Gemfile.lock found, creating it now" |
| 788 | + bundle install --path vendor/bundle # Fixed: Removed --deployment flag when lockfile doesn't exist |
| 789 | + fi |
| 790 | + bundle exec rake build |
782 | 791 | |
783 | 792 | # - name: Configure git for private modules |
784 | 793 | # env: |
@@ -1304,6 +1313,7 @@ jobs: |
1304 | 1313 | generate-msft-sbom: ${{ inputs.generate-msft-sbom }} |
1305 | 1314 | license_scout: ${{ inputs.license_scout }} |
1306 | 1315 | go-private-modules: ${{ inputs.go-private-modules }} |
| 1316 | + run-bundle-install: ${{ inputs.run-bundle-install }} # Passed to sbom.yml to generate Gemfile.lock at runtime |
1307 | 1317 |
|
1308 | 1318 | quality-dashboard: |
1309 | 1319 | name: 'Reporting to quality dashboard' |
|
0 commit comments