diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index c136e1b..ed14800 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -9,6 +9,10 @@ jobs: runs-on: ubuntu-latest permissions: {} steps: + - name: Harden Runner (egress audit) + uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0 + with: + egress-policy: audit # 用 App 身份合并:GITHUB_TOKEN 的合并不会触发下游 workflow(release 等), # App 令牌会触发;且合并动作在审计日志中归属 cloudbird-agent[bot]。 - uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v3.2.0 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 0000000..7121f9f --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,32 @@ +name: scorecard +on: + branch_protection_rule: + schedule: + - cron: "0 6 * * 1" + push: + branches: [main] + +permissions: read-all + +jobs: + analysis: + runs-on: ubuntu-latest + permissions: + security-events: write + id-token: write + contents: read + actions: read + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Scorecard analysis + uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4 + with: + results_file: results.sarif + results_format: sarif + publish_results: true + - name: Upload SARIF + uses: github/codeql-action/upload-sarif@c16c0f3f2812ec4bb3750a5ed64873fe2ce0fbef # codeql-bundle-v2.26.3 + with: + sarif_file: results.sarif