From a14c33f5fb04e6220829880ae09060ea2adf1d5a Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 21 Aug 2026 14:51:24 +0200 Subject: [PATCH] Harden GitHub Actions --- .github/actions/setup/action.yml | 6 +++--- .github/workflows/test.yml | 15 ++++++++++----- .github/workflows/update-go.yml | 7 +++++-- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index c3dbb89..5786963 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -10,16 +10,16 @@ runs: using: "composite" steps: - name: Install Just - uses: extractions/setup-just@v3 + uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 env: GITHUB_TOKEN: ${{ github.token }} - name: Setup Go (override) - uses: actions/setup-go@v6 + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 if: ${{ inputs.go-version }} with: go-version: ${{ inputs.go-version }} - name: Setup Go - uses: actions/setup-go@v6 + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 if: ${{ !inputs.go-version }} with: go-version-file: go.mod diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7cbcf61..5b24852 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,13 +13,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-depth: 0 + persist-credentials: false - name: Run Common Setup uses: ./.github/actions/setup - name: golangci-lint - uses: golangci/golangci-lint-action@v8 + uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1 with: verify: false - run: just lint @@ -28,9 +29,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-depth: 0 + persist-credentials: false - name: Run Common Setup uses: ./.github/actions/setup - run: just test @@ -39,9 +41,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-depth: 0 + persist-credentials: false - name: Run Common Setup uses: ./.github/actions/setup - run: just test-integration @@ -55,7 +58,9 @@ jobs: test: ['test', 'build', 'test-cpu-detection', 'test-os-detection'] steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false - name: Run Common Setup uses: ./.github/actions/setup - name: Install Qemu diff --git a/.github/workflows/update-go.yml b/.github/workflows/update-go.yml index 6d27864..ed0258f 100644 --- a/.github/workflows/update-go.yml +++ b/.github/workflows/update-go.yml @@ -13,10 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: token: ${{ secrets.MAINTENANCE_TOKEN }} fetch-depth: 0 + persist-credentials: false - name: Run Common Setup uses: ./.github/actions/setup with: @@ -35,7 +36,9 @@ jobs: - name: Run all tests run: just test-all - name: Commit updates - uses: stefanzweifel/git-auto-commit-action@v7 + uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0 + env: + GITHUB_TOKEN: ${{ secrets.MAINTENANCE_TOKEN }} with: commit_message: Update Go dependencies commit_user_name: Maintenance Bob