2022-10-19 12:57:45 +05:30
|
|
|
name: Scorecards supply-chain security
|
2023-01-05 23:36:13 +01:00
|
|
|
|
2022-10-19 12:57:45 +05:30
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '30 1 * * 6'
|
|
|
|
push:
|
2023-01-05 23:36:13 +01:00
|
|
|
branches:
|
|
|
|
- main
|
2022-10-19 12:57:45 +05:30
|
|
|
|
2023-01-06 16:24:55 +01:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-10-19 12:57:45 +05:30
|
|
|
jobs:
|
|
|
|
analysis:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
security-events: write
|
|
|
|
id-token: write
|
|
|
|
steps:
|
2023-01-05 23:36:13 +01:00
|
|
|
- name: Checkout
|
2023-04-14 07:52:25 +00:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-10-19 12:57:45 +05:30
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2023-01-07 05:36:47 +01:00
|
|
|
- name: Check secret
|
|
|
|
id: checksecret
|
|
|
|
uses: ./.github/actions/is-defined
|
|
|
|
with:
|
|
|
|
value: ${{ secrets.SCORECARD_READ_TOKEN }}
|
2023-01-05 23:36:13 +01:00
|
|
|
- name: Setup build env
|
2023-01-07 05:36:47 +01:00
|
|
|
if: steps.checksecret.outputs.result == 'true'
|
2023-01-05 23:36:13 +01:00
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
- name: Run analysis
|
2023-01-07 05:36:47 +01:00
|
|
|
if: steps.checksecret.outputs.result == 'true'
|
2023-03-30 14:09:29 +00:00
|
|
|
uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.1.3
|
2022-10-19 12:57:45 +05:30
|
|
|
with:
|
|
|
|
results_file: results.sarif
|
|
|
|
results_format: sarif
|
|
|
|
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
|
|
|
|
publish_results: true
|
2023-01-05 23:36:13 +01:00
|
|
|
- name: Upload artifact
|
2023-01-07 05:36:47 +01:00
|
|
|
if: steps.checksecret.outputs.result == 'true'
|
2023-01-09 09:05:26 +00:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2022-10-19 12:57:45 +05:30
|
|
|
with:
|
|
|
|
name: SARIF file
|
|
|
|
path: results.sarif
|
|
|
|
retention-days: 5
|
2023-01-05 23:36:13 +01:00
|
|
|
- name: Upload to code-scanning
|
2023-01-07 05:36:47 +01:00
|
|
|
if: steps.checksecret.outputs.result == 'true'
|
2023-05-26 15:53:56 +08:00
|
|
|
uses: github/codeql-action/upload-sarif@0225834cc549ee0ca93cb085b92954821a145866 # v2.3.5
|
2022-10-19 12:57:45 +05:30
|
|
|
with:
|
|
|
|
sarif_file: results.sarif
|