Skip to content

Commit 262be2c

Browse files
ci: migrate OSSF Scorecard to shared workflow
1 parent cd252b4 commit 262be2c

1 file changed

Lines changed: 7 additions & 38 deletions

File tree

‎.github/workflows/ossf-scorecard.yml‎

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,14 @@ on:
88
- cron: "56 23 * * 6" # once a week
99
workflow_dispatch:
1010

11-
permissions: read-all
11+
permissions: {}
1212

1313
jobs:
1414
analysis:
15-
runs-on: ubuntu-latest
1615
permissions:
17-
# Needed for Code scanning upload
18-
security-events: write
19-
# Needed for GitHub OIDC token if publish_results is true
20-
id-token: write
21-
steps:
22-
- name: Harden the runner (Audit all outbound calls)
23-
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
24-
with:
25-
egress-policy: audit
26-
27-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
28-
with:
29-
persist-credentials: false
30-
31-
- uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4
32-
with:
33-
results_file: results.sarif
34-
results_format: sarif
35-
publish_results: true
36-
37-
# Upload the results as artifacts (optional). Commenting out will disable
38-
# uploads of run results in SARIF format to the repository Actions tab.
39-
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
40-
- name: "Upload artifact"
41-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
42-
with:
43-
name: SARIF file
44-
path: results.sarif
45-
retention-days: 5
46-
47-
# Upload the results to GitHub's code scanning dashboard (optional).
48-
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
49-
- name: "Upload to code-scanning"
50-
uses: github/codeql-action/upload-sarif@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
51-
with:
52-
sarif_file: results.sarif
16+
contents: read # for actions/checkout
17+
id-token: write # for Scorecard to publish results
18+
security-events: write # for the SARIF upload to code scanning
19+
uses: open-telemetry/shared-workflows/.github/workflows/scorecard.yml@ee32c419ea90b05286c0cdc24538d970992cf82a # v0.11.0
20+
with:
21+
use-harden-runner: true

0 commit comments

Comments
 (0)