|
| 1 | +name: Scorecard analysis workflow |
| 2 | +on: |
| 3 | + push: |
| 4 | + # Only the default branch is supported. |
| 5 | + branches: |
| 6 | + - dev |
| 7 | + schedule: |
| 8 | + # Weekly on Saturdays. |
| 9 | + - cron: '30 1 * * 6' |
| 10 | + |
| 11 | +permissions: read-all |
| 12 | + |
| 13 | +jobs: |
| 14 | + analysis: |
| 15 | + name: Scorecard analysis |
| 16 | + runs-on: ubuntu-latest |
| 17 | + permissions: |
| 18 | + # Needed for Code scanning upload |
| 19 | + security-events: write |
| 20 | + # Needed for GitHub OIDC token if publish_results is true |
| 21 | + id-token: write |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: "Checkout code" |
| 25 | + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 |
| 26 | + with: |
| 27 | + ref: ${{ github.event.inputs.branch }} |
| 28 | + path: ${{ github.sha }} |
| 29 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 30 | + |
| 31 | + - name: "Run analysis" |
| 32 | + uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 |
| 33 | + with: |
| 34 | + results_file: results.sarif |
| 35 | + results_format: sarif |
| 36 | + # Scorecard team runs a weekly scan of public GitHub repos, |
| 37 | + # see https://github.com/ossf/scorecard#public-data. |
| 38 | + # Setting `publish_results: true` helps us scale by leveraging your workflow to |
| 39 | + # extract the results instead of relying on our own infrastructure to run scans. |
| 40 | + # And it's free for you! |
| 41 | + publish_results: true |
| 42 | + |
| 43 | + # Upload the results as artifacts (optional). Commenting out will disable |
| 44 | + # uploads of run results in SARIF format to the repository Actions tab. |
| 45 | + # https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts |
| 46 | + - name: "Upload artifact" |
| 47 | + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 |
| 48 | + with: |
| 49 | + name: SARIF file |
| 50 | + path: results.sarif |
| 51 | + retention-days: 5 |
| 52 | + |
| 53 | + # Upload the results to GitHub's code scanning dashboard (optional). |
| 54 | + # Commenting out will disable upload of results to your repo's Code Scanning dashboard |
| 55 | + - name: "Upload to code-scanning" |
| 56 | + uses: github/codeql-action/upload-sarif@8f596b4ae3cb3c588a5c46780b86dd53fef16c52 # v3.25.2 |
| 57 | + with: |
| 58 | + sarif_file: results.sarif |
0 commit comments