Skip to content

Commit 4ee8d09

Browse files
committed
Fixes for ruby code
Signed-off-by: sandhi <sagarwal@progress.com>
1 parent 68026c2 commit 4ee8d09

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ on:
105105
description: 'Fail pipeline if Trivy finds HIGH or CRITICAL vulnerabilities'
106106
required: false
107107
type: boolean
108-
default: true
108+
default: false
109109

110110
build:
111111
description: 'CI Build (language-specific)'
@@ -169,15 +169,15 @@ on:
169169
type: string
170170
polaris-coverity-clean-command:
171171
# NEW IN 1.0.7
172-
description: 'Coverity clean command, typically done before build stage by language or here as param 1-liner like "mvn clean"'
172+
description: 'Coverity clean command, typically done before build stage by language or here as param 1-liner like "mvn clean". Leave empty for buildless analysis (Ruby, Python, etc.)'
173173
required: false
174-
default: 'go clean'
174+
default: ''
175175
type: string
176176
polaris-coverity-build-command:
177177
# NEW IN 1.0.7
178-
description: 'Coverity build command, typically done in build stage by language or here as param 1-liner like "mvn clean install"'
178+
description: 'Coverity build command, typically done in build stage by language or here as param 1-liner like "mvn clean install". Leave empty for buildless analysis (Ruby, Python, etc.)'
179179
required: false
180-
default: 'go build'
180+
default: ''
181181
type: string
182182
polaris-coverity-args:
183183
# NEW IN 1.0.7
@@ -374,6 +374,11 @@ on:
374374
required: false
375375
type: boolean
376376
default: false
377+
ruby-app-directory:
378+
description: 'Subdirectory containing Ruby Gemfile (e.g., "src/supermarket" for repos with non-root Gemfile location). Leave empty if Gemfile is in root.'
379+
required: false
380+
type: string
381+
default: ''
377382

378383
udf1:
379384
description: 'User defined flag 1'
@@ -716,7 +721,7 @@ jobs:
716721
run-trivy:
717722
name: 'Trivy scan'
718723
if: ${{ inputs.perform-trivy-scan }}
719-
uses: chef/common-github-actions/.github/workflows/trivy.yml@sandhi/fix-blackduc-sca
724+
uses: chef/common-github-actions/.github/workflows/trivy.yml@main
720725
needs: checkout
721726
with:
722727
version: ${{ inputs.version }}
@@ -1024,11 +1029,6 @@ jobs:
10241029
with:
10251030
fetch-depth: 0
10261031

1027-
- name: Configure git for private Go modules
1028-
env:
1029-
GOPRIVATE: ${{ inputs.go-private-modules }}
1030-
run: git config --global url."https://${{ secrets.GH_TOKEN }}@github.com/".insteadOf "https://github.com/"
1031-
10321032
- name: Install build tools for Erlang
10331033
if: inputs.language == 'erlang'
10341034
run: |
@@ -1046,7 +1046,7 @@ jobs:
10461046
if: inputs.language == 'ruby'
10471047
uses: ruby/setup-ruby@v1
10481048
with:
1049-
ruby-version: '3.0'
1049+
ruby-version: '3.4'
10501050
bundler-cache: false
10511051

10521052
- name: Create bundle stub for Erlang SAST scan
@@ -1381,7 +1381,7 @@ jobs:
13811381
name: 'Generating SBOM'
13821382
# Create software bill-of-materials (SBOM) using SPDX format
13831383
if: ${{ inputs.generate-sbom == true }}
1384-
uses: chef/common-github-actions/.github/workflows/sbom.yml@sandhi/fix-blackduc-sca
1384+
uses: chef/common-github-actions/.github/workflows/sbom.yml@main
13851385
needs: checkout # TODO: fix set-application-version
13861386
secrets: inherit
13871387
with:
@@ -1397,6 +1397,7 @@ jobs:
13971397
blackduck-force-low-accuracy-mode: ${{ inputs.blackduck-force-low-accuracy-mode }}
13981398
run-bundle-install: ${{ inputs.run-bundle-install }} # Passed to sbom.yml to generate Gemfile.lock at runtime
13991399
language: ${{ inputs.language }}
1400+
ruby-app-directory: ${{ inputs.ruby-app-directory }}
14001401

14011402
quality-dashboard:
14021403
name: 'Reporting to quality dashboard'

.github/workflows/sbom.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ on:
7777
required: false
7878
type: string
7979
default: 'ruby'
80+
ruby-app-directory:
81+
description: 'Subdirectory containing Ruby Gemfile (e.g., "src/supermarket" for repos with non-root Gemfile location). Leave empty if Gemfile is in root.'
82+
required: false
83+
type: string
84+
default: ''
8085

8186
env:
8287
# Set the default SBOM filename prefix
@@ -207,7 +212,8 @@ jobs:
207212
uses: ruby/setup-ruby@v1
208213
with:
209214
ruby-version: '3.4.2'
210-
bundler-cache: true
215+
bundler-cache: false
216+
working-directory: ${{ inputs.ruby-app-directory != '' && inputs.ruby-app-directory || '.' }}
211217

212218
- name: Set up Erlang/OTP and rebar3
213219
if: inputs.language == 'erlang'
@@ -225,6 +231,7 @@ jobs:
225231
- name: generate Gemfile.lock if needed for Ruby projects
226232
if: ${{ inputs.run-bundle-install == true && inputs.language == 'ruby' }}
227233
continue-on-error: true
234+
working-directory: ${{ inputs.ruby-app-directory != '' && inputs.ruby-app-directory || '.' }}
228235
run: |
229236
if [ ! -f Gemfile.lock ]; then
230237
bundle install
@@ -235,7 +242,7 @@ jobs:
235242
uses: actions/upload-artifact@v4
236243
continue-on-error: true
237244
with:
238-
path: Gemfile.lock
245+
path: ${{ inputs.ruby-app-directory != '' && format('{0}/Gemfile.lock', inputs.ruby-app-directory) || 'Gemfile.lock' }}
239246
name: ${{ github.event.repository.name }}-Gemfile-lock.txt
240247

241248
- name: BlackDuck SCA scan
@@ -249,7 +256,8 @@ jobs:
249256
with:
250257
blackducksca_url: ${{ secrets.BLACKDUCK_SBOM_URL }} # BLACKDUCK_URL, should be https://progresssoftware.app.blackduck.com/
251258
blackducksca_token: ${{ secrets.BLACKDUCK_SCA_TOKEN }} # was BLACKDUCK_API_KEY
252-
detect_args: ${{ inputs.blackduck-force-low-accuracy-mode == true && '--detect.excluded.detector.types=PIP --detect.accuracy.required=NONE' || '--detect.excluded.detector.types=PIP' }}
259+
blackducksca_scan_full: true # Force INTELLIGENT scan mode for all branches (uploads results to server)
260+
detect_args: ${{ inputs.ruby-app-directory != '' && format('{0} --detect.source.path={1}', inputs.blackduck-force-low-accuracy-mode == true && '--detect.excluded.detector.types=PIP --detect.accuracy.required=NONE' || '--detect.excluded.detector.types=PIP', inputs.ruby-app-directory) || (inputs.blackduck-force-low-accuracy-mode == true && '--detect.excluded.detector.types=PIP --detect.accuracy.required=NONE' || '--detect.excluded.detector.types=PIP') }}
253261
# blackducksca_scan_failure_severities: 'BLOCKER,CRITICAL'
254262
# ignore python per https://documentation.blackduck.com/bundle/detect/page/packagemgrs/python.html
255263

.github/workflows/trivy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
description: 'Fail the build if HIGH or CRITICAL vulnerabilities are found'
2020
required: false
2121
type: boolean
22-
default: true
22+
default: false
2323

2424
jobs:
2525
trivy:

0 commit comments

Comments
 (0)