From e9aba4cb2c3d1cb5777cc1b6123779756be330d1 Mon Sep 17 00:00:00 2001 From: Nicklas Lundin Date: Wed, 20 May 2026 12:59:02 +0200 Subject: [PATCH] fix(ci): pin GitHub Actions to commit SHAs and fix cache poisoning Mitigate supply chain attacks by pinning all third-party actions to immutable commit SHAs. Switch PR build cache to read-only restore to prevent fork PRs from poisoning the shared Gradle cache. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/lint-pr.yaml | 6 +++--- .github/workflows/release-please.yaml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 46fed8bd..e1fb58e1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 20 steps: - name: Cache Gradle and wrapper - uses: actions/cache@v4 + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: path: | ~/.gradle/caches @@ -26,10 +26,10 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Set up JDK 17 - uses: actions/setup-java@v5 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 with: java-version: 17 distribution: 'zulu' diff --git a/.github/workflows/lint-pr.yaml b/.github/workflows/lint-pr.yaml index 73782e92..83fd5a6a 100644 --- a/.github/workflows/lint-pr.yaml +++ b/.github/workflows/lint-pr.yaml @@ -16,12 +16,12 @@ jobs: name: Validate PR title runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@v5 + - uses: amannn/action-semantic-pull-request@e32d7e603df1aa1ba07e981f2a23455dee596825 # v5 id: lint_pr_title env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: marocchino/sticky-pull-request-comment@v2 + - uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2 # When the previous steps fails, the workflow would stop. By adding this # condition you can continue the execution with the populated error message. if: always() && (steps.lint_pr_title.outputs.error_message != null) @@ -40,7 +40,7 @@ jobs: # Delete a previous comment when the issue has been resolved - if: ${{ steps.lint_pr_title.outputs.error_message == null }} - uses: marocchino/sticky-pull-request-comment@v2 + uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2 with: header: pr-title-lint-error delete: true diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index c6902f06..d95c0fea 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -14,7 +14,7 @@ jobs: # Release-please creates a PR that tracks all changes steps: - - uses: google-github-actions/release-please-action@v3 + - uses: google-github-actions/release-please-action@db8f2c60ee802b3748b512940dde88eabd7b7e01 # v3 id: release with: release-type: simple @@ -37,7 +37,7 @@ jobs: steps: # The logic below handles the github release: - name: Cache Gradle and wrapper - uses: actions/cache@v4 + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 with: path: | ~/.gradle/caches @@ -46,7 +46,7 @@ jobs: restore-keys: | ${{ runner.os }}-gradle- - - uses: actions/checkout@v4 + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: ref: ${{ needs.release-please.outputs.release_tag_name }} @@ -69,7 +69,7 @@ jobs: GPG_SIGNING_KEY_PASSWORD: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }} - name: Set up JDK 17 - uses: actions/setup-java@v5 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 with: java-version: 17 distribution: 'zulu'