From afe4d6dcb8bb6d9a4ec7f882c5ecdde724c60c2c Mon Sep 17 00:00:00 2001 From: Hardy Nguyen Date: Sun, 26 Jul 2026 21:11:29 +0700 Subject: [PATCH] chore: add ossf-scorecard.yml --- .github/workflows/ossf-scorecard.yml | 63 ++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/ossf-scorecard.yml diff --git a/.github/workflows/ossf-scorecard.yml b/.github/workflows/ossf-scorecard.yml new file mode 100644 index 000000000..ef84b6775 --- /dev/null +++ b/.github/workflows/ossf-scorecard.yml @@ -0,0 +1,63 @@ +name: Scorecard supply-chain security + +on: + branch_protection_rule: + push: + branches: + - main + paths-ignore: + - '**.md' + - '.gitignore' + schedule: + # ┌───────────── minute (0 - 59) + # │ ┌───────────── hour (0 - 23) + # │ │ ┌───────────── day of the month (1 - 31) + # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) + # │ │ │ │ │ + - cron: "4 5 * * 3" + workflow_dispatch: + +concurrency: + group: "${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" + cancel-in-progress: true + +permissions: + contents: read + +jobs: + ossf-scorecard-analysis: + name: OSSF Scorecard Analysis + runs-on: ubuntu-latest + + permissions: + contents: read + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + + steps: + - name: Checkout code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Perform OSSF Scorecard analysis + uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 + with: + results_file: results.sarif + results_format: sarif + publish_results: ${{ inputs.publish_results && github.ref_name == github.event.repository.default_branch }} + + - name: Upload artifact + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + - name: Upload to Code Scanning + uses: github/codeql-action/upload-sarif@7188fc363630916deb702c7fdcf4e481b751f97a # v4.37.1 + with: + sarif_file: results.sarif