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-03-16 09:25:58 +00:00
|
|
|
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0
|
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-01-05 23:36:13 +01:00
|
|
|
uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
|
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-03-23 15:36:37 +08:00
|
|
|
uses: github/codeql-action/upload-sarif@67a35a08586135a9573f4327e904ecbf517a882d # v2.2.8
|
2022-10-19 12:57:45 +05:30
|
|
|
with:
|
|
|
|
sarif_file: results.sarif
|