From 289b0b728004253c1806adadc38fe3d7f9adc02a Mon Sep 17 00:00:00 2001 From: Thib_C Date: Wed, 4 Nov 2026 10:28:29 +0100 Subject: [PATCH] ci: lock workflow actions and verify the lockfile on PRs Add .github/workflows/actions.lock, generated by gh actions-lock v0.4.0, and a Lockfile check that runs gh actions-lock --verify on pull requests and pushes to main. Workflow refs become tags, and the lockfile holds the commits. Every locked commit equals what ran before. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/actions.lock | 98 +++++++++++++++++++++++++++ .github/workflows/ci.yml | 10 +-- .github/workflows/plumber.yml | 4 +- .github/workflows/release.yml | 6 +- .github/workflows/verify-lockfile.yml | 36 ++++++++++ README.md | 11 ++- 6 files changed, 154 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/actions.lock create mode 100644 .github/workflows/verify-lockfile.yml diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock new file mode 100644 index 0000000..9094384 --- /dev/null +++ b/.github/workflows/actions.lock @@ -0,0 +1,98 @@ +# This file is machine-generated by `gh actions-lock`. +# Do not edit by hand; run `gh actions-lock` to update. +# Docs: https://gh.io/actions-lockfile +version: 'v0.0.3' +workflows: + '.github/workflows/ci.yml': + - 'actions/checkout@v3.1.0' + - 'actions/checkout@v3.7.0' + - 'actions/setup-python@v4.3.0' + - 'azure/setup-helm@v3.5' + - 'd3adb5/helm-unittest-action@v2.5.0' + - 'dorny/test-reporter@v2.1.1' + - 'helm/chart-testing-action@v2.3.1' + '.github/workflows/plumber.yml': + - 'actions/checkout@v5.0.0' + - 'getplumber/plumber@v0.7.18' + '.github/workflows/release.yml': + - 'actions/checkout@v3.7.0' + - 'azure/setup-helm@v3.5' + - 'helm/chart-releaser-action@v1.7.0' + '.github/workflows/verify-lockfile.yml': + - 'actions/checkout@v7.0.1' +dependencies: + 'actions/checkout@v3.1.0': + ref: 'v3.1.0' + commit: 'sha1-93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8' + owner_id: 44036562 + repo_id: 197814629 + 'actions/checkout@v3.7.0': + ref: 'v3.7.0' + commit: 'sha1-a37ce9120846195fa4ece8f58b268e6043cb2f26' + owner_id: 44036562 + repo_id: 197814629 + 'actions/checkout@v5.0.0': + ref: 'v5.0.0' + commit: 'sha1-08c6903cd8c0fde910a37f88322edcfb5dd907a8' + owner_id: 44036562 + repo_id: 197814629 + 'actions/checkout@v7.0.1': + ref: 'v7.0.1' + commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1' + owner_id: 44036562 + repo_id: 197814629 + 'actions/setup-python@v4.3.0': + ref: 'v4.3.0' + commit: 'sha1-13ae5bb136fac2878aff31522b9efb785519f984' + owner_id: 44036562 + repo_id: 192625525 + 'actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9': + ref: 'v7.0.2' + commit: 'sha1-cf430e030ddbb5b0abf93d22962f4752f3646cd9' + owner_id: 44036562 + repo_id: 192625955 + 'azure/setup-helm@v3.5': + ref: 'v3.5' + commit: 'sha1-5119fcb9089d432beecbf79bb2c7915207344b78' + owner_id: 6844498 + repo_id: 210310251 + 'azure/setup-helm@v4.0.0': + ref: 'v4.0.0' + commit: 'sha1-29960d0f5f19214b88e1d9ba750a9914ab0f1a2f' + owner_id: 6844498 + repo_id: 210310251 + 'd3adb5/helm-unittest-action@v2.5.0': + ref: 'v2.5.0' + commit: 'sha1-850bc76597579183998069830d5fa8c3ef0ea34a' + owner_id: 8827351 + repo_id: 507203882 + uses: + - 'azure/setup-helm@v4.0.0' + 'dorny/test-reporter@v2.1.1': + ref: 'v2.1.1' + commit: 'sha1-dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3' + owner_id: 1588572 + repo_id: 300422142 + 'getplumber/plumber@v0.7.18': + ref: 'v0.7.18' + commit: 'sha1-ebc213aa45dccd233ce5c2630f0aafa8e8d650c5' + owner_id: 255179076 + repo_id: 1137327132 + uses: + - 'actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9' + - 'github/codeql-action@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee' + 'github/codeql-action@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee': + ref: 'v4.39.0' + commit: 'sha1-6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee' + owner_id: 9919 + repo_id: 259445878 + 'helm/chart-releaser-action@v1.7.0': + ref: 'v1.7.0' + commit: 'sha1-cae68fefc6b5f367a0275617c9f83181ba54714f' + owner_id: 15859888 + repo_id: 223775198 + 'helm/chart-testing-action@v2.3.1': + ref: 'v2.3.1' + commit: 'sha1-afea100a513515fbd68b0e72a7bb0ae34cb62aec' + owner_id: 15859888 + repo_id: 223435665 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de94a67..c61e12a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: with: fetch-depth: 0 - name: Install Helm - uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 + uses: azure/setup-helm@v3.5 with: version: 3.10.1 - name: Install Python @@ -34,7 +34,7 @@ jobs: with: python-version: 3.11 - name: Install chart-testing - uses: helm/chart-testing-action@afea100a513515fbd68b0e72a7bb0ae34cb62aec # v2.3.1 + uses: helm/chart-testing-action@v2.3.1 - name: Add dependency chart repositories run: ./scripts/add_helm_repo.sh - name: List changed charts @@ -56,8 +56,8 @@ jobs: name: Unit tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: d3adb5/helm-unittest-action@850bc76597579183998069830d5fa8c3ef0ea34a # 2.5.0 + - uses: actions/checkout@v3.7.0 + - uses: d3adb5/helm-unittest-action@v2.5.0 with: charts: charts/plumber flags: --color -o test-results.xml --output-type JUnit @@ -67,7 +67,7 @@ jobs: # parse. Pin to the last v1.x release using the legacy schema. unittest-version: v1.0.3 - name: Test Report - uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 # v2.1.1 + uses: dorny/test-reporter@v2.1.1 if: ${{ !cancelled() }} # run this step even if previous step failed with: name: Helm Unit Tests # Name of the check run which will be created diff --git a/.github/workflows/plumber.yml b/.github/workflows/plumber.yml index 6f7fb28..9adbb61 100644 --- a/.github/workflows/plumber.yml +++ b/.github/workflows/plumber.yml @@ -24,11 +24,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@v5.0.0 with: persist-credentials: false - name: Run Plumber - uses: getplumber/plumber@ebc213aa45dccd233ce5c2630f0aafa8e8d650c5 # pinned plumber version: v0.7.18 + uses: getplumber/plumber@v0.7.18 with: min-points: 90 score-push: true # publish the Plumber Score badge (repo name + score become public) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c858ad3..a17e2a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: pages: write steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v3.7.0 with: fetch-depth: 0 - name: Configure Git @@ -22,13 +22,13 @@ jobs: git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - name: Install Helm - uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 + uses: azure/setup-helm@v3.5 with: version: 3.10.1 - name: Add dependency chart repositories run: ./scripts/add_helm_repo.sh - name: Run chart-releaser - uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0 + uses: helm/chart-releaser-action@v1.7.0 env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" CR_RELEASE_NAME_TEMPLATE: "v{{ .Version }}" diff --git a/.github/workflows/verify-lockfile.yml b/.github/workflows/verify-lockfile.yml new file mode 100644 index 0000000..1b31571 --- /dev/null +++ b/.github/workflows/verify-lockfile.yml @@ -0,0 +1,36 @@ +name: Lockfile + +# Fails when .github/workflows/actions.lock is out of sync with the workflows, +# or when a locked commit no longer verifies upstream (moved tag, renamed or +# replaced repository). No paths filter: this is meant to be a required check, +# and a filtered required check never reports on PRs it skips. + +on: + pull_request: + branches: [main] + push: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: {} + +jobs: + verify: + name: Lockfile + runs-on: ubuntu-24.04 + timeout-minutes: 5 + permissions: + contents: read + env: + GH_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v7.0.1 + with: + persist-credentials: false + - name: Install gh-actions-lock + run: gh extension install github/gh-actions-lock --pin v0.4.0 + - name: Verify the lockfile + run: gh actions-lock --verify diff --git a/README.md b/README.md index 4ff45a2..8def490 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,13 @@ This project contains resources to setup a self-managed instance of [Plumber](ht You are welcome to help us improve this repository! -🎮 Open an Issue or create Pull Requests from your fork \ No newline at end of file +🎮 Open an Issue or create Pull Requests from your fork + +### Changing GitHub workflows + +Every action our workflows use is locked in `.github/workflows/actions.lock`: its commit, its owner and repository ids, and the actions it calls in turn. The `Lockfile` check fails a PR whose workflows the lockfile doesn't fully cover. + +- After adding a workflow or changing any `uses:`, run `gh actions-lock` from the repository root (install it with `gh extension install github/gh-actions-lock`) and commit the updated lockfile with the workflow change. +- Never edit `actions.lock` by hand. +- Optional, before committing: `gh actions-lock --verify-local --no-fix` checks coverage offline. CI runs the full `gh actions-lock --verify`. +- Review a lockfile change as a dependency change: a changed `commit` is new code that will run, and a changed `owner_id` or `repo_id` means the repository behind the name is not the one we locked.