Skip to content

Commit 85c6b7a

Browse files
authored
Merge pull request #2786 from spencerschrock/scorecard-bug-fix
fix: Scorecard artifact upload and version bump
2 parents 17ba94a + 0d93bc2 commit 85c6b7a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

code-scanning/scorecard.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
analysis:
2222
name: Scorecard analysis
2323
runs-on: ubuntu-latest
24+
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
25+
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
2426
permissions:
2527
# Needed to upload the results to code-scanning dashboard.
2628
security-events: write
@@ -32,12 +34,12 @@ jobs:
3234

3335
steps:
3436
- name: "Checkout code"
35-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
37+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3638
with:
3739
persist-credentials: false
3840

3941
- name: "Run analysis"
40-
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
42+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
4143
with:
4244
results_file: results.sarif
4345
results_format: sarif
@@ -56,10 +58,13 @@ jobs:
5658
# of the value entered here.
5759
publish_results: true
5860

61+
# (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore
62+
# file_mode: git
63+
5964
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6065
# format to the repository Actions tab.
6166
- name: "Upload artifact"
62-
uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
67+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
6368
with:
6469
name: SARIF file
6570
path: results.sarif

0 commit comments

Comments
 (0)