From 7c1f2b09f29854418e7d20ee51ccd3af175a69e1 Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Sun, 22 Nov 2026 06:59:49 +0800 Subject: [PATCH] chore(ci): pin actions to commit SHAs and harden workflow permissions --- .github/workflows/ci.yml | 4 ++-- .github/workflows/dependabot_auto_merge.yml | 3 +++ .github/workflows/engineering-governance.yml | 2 +- .github/workflows/hide-codex-limit-comments.yml | 5 ++++- .github/workflows/risk-gate.yml | 6 +++--- .github/workflows/rss_source_pipeline.yml | 6 +++--- .github/workflows/source_event_pipeline.yml | 6 +++--- 7 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5af255..5f22b99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,8 +12,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 with: python-version: "3.11" - name: Install package diff --git a/.github/workflows/dependabot_auto_merge.yml b/.github/workflows/dependabot_auto_merge.yml index 5408f64..9327754 100644 --- a/.github/workflows/dependabot_auto_merge.yml +++ b/.github/workflows/dependabot_auto_merge.yml @@ -5,6 +5,9 @@ name: Auto Merge Dependabot PR workflows: ["CI"] types: [completed] +permissions: + contents: read + jobs: auto-merge: if: github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'dependabot/') diff --git a/.github/workflows/engineering-governance.yml b/.github/workflows/engineering-governance.yml index baa1ba5..1530200 100644 --- a/.github/workflows/engineering-governance.yml +++ b/.github/workflows/engineering-governance.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 0 persist-credentials: false - name: Scan added commits with redacted findings - uses: Pigbibi/PrGovernance/pr-governance@ccda8de572d2893272b0137526ef3e2d45e5eee7 + uses: Pigbibi/PrGovernance/pr-governance@7fe2ee20a3ee144ea944619e1c56f7ed5edc9152 with: mode: scan diff --git a/.github/workflows/hide-codex-limit-comments.yml b/.github/workflows/hide-codex-limit-comments.yml index ed525b7..2496007 100644 --- a/.github/workflows/hide-codex-limit-comments.yml +++ b/.github/workflows/hide-codex-limit-comments.yml @@ -6,6 +6,9 @@ on: pull_request_review_comment: types: [created] +permissions: + contents: read + jobs: hide-comment: runs-on: ubuntu-latest @@ -23,7 +26,7 @@ jobs: pull-requests: write steps: - name: Minimize comment - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 with: script: | const mutation = ` diff --git a/.github/workflows/risk-gate.yml b/.github/workflows/risk-gate.yml index 4fed368..7f4c1e8 100644 --- a/.github/workflows/risk-gate.yml +++ b/.github/workflows/risk-gate.yml @@ -20,7 +20,7 @@ on: # A merge made with GITHUB_TOKEN raises no push, and nothing raises an event # for a resolved review thread, so a sweep closes both gaps. schedule: - - cron: '17 */6 * * *' + - cron: '17 3 * * *' workflow_dispatch: inputs: pr_number: @@ -51,7 +51,7 @@ jobs: statuses: write steps: - name: Record label head - uses: Pigbibi/PrGovernance/pr-governance@ccda8de572d2893272b0137526ef3e2d45e5eee7 + uses: Pigbibi/PrGovernance/pr-governance@7fe2ee20a3ee144ea944619e1c56f7ed5edc9152 env: GOVERNANCE_OWNER_ID: ${{ vars.RISK_GATE_OWNER_ID }} GOVERNANCE_OWNER_LOGIN: ${{ vars.RISK_GATE_OWNER }} @@ -85,7 +85,7 @@ jobs: cancel-in-progress: true steps: - name: Evaluate - uses: Pigbibi/PrGovernance/pr-governance@ccda8de572d2893272b0137526ef3e2d45e5eee7 + uses: Pigbibi/PrGovernance/pr-governance@7fe2ee20a3ee144ea944619e1c56f7ed5edc9152 env: GOVERNANCE_OWNER_ID: ${{ vars.RISK_GATE_OWNER_ID }} GOVERNANCE_OWNER_LOGIN: ${{ vars.RISK_GATE_OWNER }} diff --git a/.github/workflows/rss_source_pipeline.yml b/.github/workflows/rss_source_pipeline.yml index 6862656..34cf908 100644 --- a/.github/workflows/rss_source_pipeline.yml +++ b/.github/workflows/rss_source_pipeline.yml @@ -175,9 +175,9 @@ jobs: with Path(os.environ["GITHUB_STEP_SUMMARY"]).open("a", encoding="utf-8") as output: output.write("Publisher identity-only result (no data published):\n" + serialized + "\n") PY - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 if: ${{ !inputs.identity_only }} - - uses: actions/setup-python@v6 + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 if: ${{ !inputs.identity_only }} with: python-version: "3.11" @@ -244,7 +244,7 @@ jobs: --handoff-dir data/output/rss_source_pipeline - name: Upload RSS source artifact if: ${{ always() && !inputs.identity_only }} - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 with: name: rss-source-pipeline path: data/output/rss_source_pipeline/ diff --git a/.github/workflows/source_event_pipeline.yml b/.github/workflows/source_event_pipeline.yml index 7839f12..c32ceb1 100644 --- a/.github/workflows/source_event_pipeline.yml +++ b/.github/workflows/source_event_pipeline.yml @@ -41,8 +41,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 with: python-version: "3.11" - name: Install package @@ -100,7 +100,7 @@ jobs: --handoff-dir data/output/source_event_pipeline - name: Upload source event artifact if: ${{ always() }} - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 with: name: source-event-pipeline path: data/output/source_event_pipeline/