From 5aa49d5eb056865d53cd556f1fa417b17064b9cf Mon Sep 17 00:00:00 2001 From: Efra Espada Date: Thu, 12 Nov 2026 11:33:15 +0100 Subject: [PATCH 1/2] ci: use exact action release versions --- .github/workflows/ci_check.yml | 10 +++++----- .github/workflows/npm_release.yml | 6 +++--- .github/workflows/storybook_pages.yml | 6 +++--- docs/storybook.md | 1 + tests/architecture.test.mjs | 10 +++++++++- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci_check.yml b/.github/workflows/ci_check.yml index 8a830fe..f032f6c 100644 --- a/.github/workflows/ci_check.yml +++ b/.github/workflows/ci_check.yml @@ -18,7 +18,7 @@ jobs: # The catalog has its own phase deadlines; this job also verifies packages and SSR. timeout-minutes: 20 steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/checkout@v7.0.1 with: persist-credentials: false - name: Validate the catalog and bind packed consumers to the checked commit @@ -26,13 +26,13 @@ jobs: env: HA_UI_PACKED_EXPECTED_REVISION: ${{ github.sha }} run: bash .github/scripts/verify-catalog.sh - - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + - uses: actions/setup-node@v7.1.0 with: node-version-file: .node-version package-manager-cache: false # Read the original catalog SDK at the reviewed revision; never rewrite it. - name: Read the original specification SDK - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + uses: actions/checkout@v7.0.1 with: repository: vypdev/copilot ref: 3e7ceea08e6131360e026937d1c0cc1b120472e0 @@ -48,7 +48,7 @@ jobs: node -e "require('./.validation/copilot-sdk/src/infrastructure/specification_catalog_validator.cjs').main([], process.cwd())" - name: Retain source coverage and compiled package evidence if: ${{ always() }} - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + uses: actions/upload-artifact@v7.0.2 with: name: shared-ui-validation-${{ github.sha }} path: | @@ -62,7 +62,7 @@ jobs: retention-days: 7 - name: Retain the verified npm candidate for the production SHA if: github.event_name == 'push' && github.ref == 'refs/heads/master' - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + uses: actions/upload-artifact@v7.0.2 with: name: npm-candidate-${{ github.sha }} path: | diff --git a/.github/workflows/npm_release.yml b/.github/workflows/npm_release.yml index 4258805..294c0b9 100644 --- a/.github/workflows/npm_release.yml +++ b/.github/workflows/npm_release.yml @@ -44,16 +44,16 @@ jobs: contents: read id-token: write steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/checkout@v7.0.1 with: persist-credentials: false ref: ${{ github.sha }} - - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.0.1 + - uses: actions/setup-node@v7.1.0 with: node-version-file: .node-version registry-url: https://registry.npmjs.org package-manager-cache: false - - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + - uses: actions/download-artifact@v8.0.2 with: name: npm-candidate-${{ github.sha }} path: ${{ runner.temp }}/ha-ui-npm-candidate diff --git a/.github/workflows/storybook_pages.yml b/.github/workflows/storybook_pages.yml index 67e5eb7..def103f 100644 --- a/.github/workflows/storybook_pages.yml +++ b/.github/workflows/storybook_pages.yml @@ -22,14 +22,14 @@ jobs: # The published catalog runs the same browser gates as CI. timeout-minutes: 20 steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/checkout@v7.0.1 with: persist-credentials: false - name: Build and verify Storybook in Linux shell: bash run: bash .github/scripts/verify-catalog.sh - name: Upload the verified Pages archive - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + uses: actions/upload-artifact@v4.6.2 with: name: github-pages path: build/artifact.tar @@ -47,4 +47,4 @@ jobs: steps: - name: Publish the verified static catalog id: deployment - uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 + uses: actions/deploy-pages@v4.0.5 diff --git a/docs/storybook.md b/docs/storybook.md index 9a21927..abd43f2 100644 --- a/docs/storybook.md +++ b/docs/storybook.md @@ -94,6 +94,7 @@ workflow builds and rechecks trusted `master`, then creates the Pages archive in Only its deployment job receives Pages write and OIDC permission. Fork workflows require maintainer approval in GitHub. +The CI, Pages and npm workflows reference complete action release versions. CI and the Pages build use Apple Silicon runners in the organization's `vypdev` group. Each runs the Linux build in a job-specific Docker container and keeps the runner's Docker credentials outside the container. The Pages deployment job uses diff --git a/tests/architecture.test.mjs b/tests/architecture.test.mjs index 89f4d1e..b7e81f3 100644 --- a/tests/architecture.test.mjs +++ b/tests/architecture.test.mjs @@ -187,9 +187,17 @@ test('Pages builds only the trusted default branch and grants write permissions expect(deploy.environment.name).toBe('github-pages');expect(workflow.concurrency['cancel-in-progress']).toBe(false); }); -test('publication preparation uses organization runners and OIDC jobs use GitHub runners', () => { +test('workflows name exact action releases and use GitHub runners for OIDC publication', () => { + const ci = parse(readFileSync('.github/workflows/ci_check.yml', 'utf8')); const pages = parse(readFileSync('.github/workflows/storybook_pages.yml', 'utf8')); const npm = parse(readFileSync('.github/workflows/npm_release.yml', 'utf8')); + for (const workflow of [ci, pages, npm]) { + for (const job of Object.values(workflow.jobs)) { + for (const step of job.steps.filter(step => step.uses)) { + expect(step.uses).toMatch(/^[\w/-]+@v[0-9]+\.[0-9]+\.[0-9]+$/u); + } + } + } expect(pages.jobs.build['runs-on']).toEqual({group: 'vypdev', labels: ['self-hosted', 'macOS', 'ARM64']}); expect(npm.jobs.candidate['runs-on']).toEqual({group: 'vypdev', labels: ['self-hosted', 'codex', 'Linux']}); for (const job of [pages.jobs.build, npm.jobs.candidate]) { From f725b3f27b3c774952ddad83991df7d7744b00dc Mon Sep 17 00:00:00 2001 From: Efra Espada Date: Thu, 12 Nov 2026 11:45:47 +0100 Subject: [PATCH 2/2] ci: lock the commits behind action release tags --- .github/workflows/actions.lock | 48 ++++++++++++++++++++++++++++++++++ docs/storybook.md | 2 ++ tests/architecture.test.mjs | 21 +++++++++------ 3 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/actions.lock diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock new file mode 100644 index 0000000..d64a1a6 --- /dev/null +++ b/.github/workflows/actions.lock @@ -0,0 +1,48 @@ +# 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_check.yml': + - 'actions/checkout@v7.0.1' + - 'actions/setup-node@v7.1.0' + - 'actions/upload-artifact@v7.0.2' + '.github/workflows/npm_release.yml': + - 'actions/checkout@v7.0.1' + - 'actions/download-artifact@v8.0.2' + - 'actions/setup-node@v7.1.0' + '.github/workflows/storybook_pages.yml': + - 'actions/checkout@v7.0.1' + - 'actions/deploy-pages@v4.0.5' + - 'actions/upload-artifact@v4.6.2' +dependencies: + 'actions/checkout@v7.0.1': + ref: 'v7.0.1' + commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1' + owner_id: 44036562 + repo_id: 197814629 + 'actions/deploy-pages@v4.0.5': + ref: 'v4.0.5' + commit: 'sha1-d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e' + owner_id: 44036562 + repo_id: 438112499 + 'actions/download-artifact@v8.0.2': + ref: 'v8.0.2' + commit: 'sha1-9000827ccba6bdab643e8b6fd33ac0654aef8333' + owner_id: 44036562 + repo_id: 192626254 + 'actions/setup-node@v7.1.0': + ref: 'v7.1.0' + commit: 'sha1-949feb2413d6458794dcd2491c4babbbce0c15c1' + owner_id: 44036562 + repo_id: 189476904 + 'actions/upload-artifact@v4.6.2': + ref: 'v4.6.2' + commit: 'sha1-ea165f8d65b6e75b540449e92b4886f43607fa02' + owner_id: 44036562 + repo_id: 192625955 + 'actions/upload-artifact@v7.0.2': + ref: 'v7.0.2' + commit: 'sha1-cf430e030ddbb5b0abf93d22962f4752f3646cd9' + owner_id: 44036562 + repo_id: 192625955 diff --git a/docs/storybook.md b/docs/storybook.md index abd43f2..fa3f111 100644 --- a/docs/storybook.md +++ b/docs/storybook.md @@ -95,6 +95,8 @@ Only its deployment job receives Pages write and OIDC permission. Fork workflows require maintainer approval in GitHub. The CI, Pages and npm workflows reference complete action release versions. +GitHub runs the commits recorded in `.github/workflows/actions.lock`. Regenerate the lockfile with +`gh actions-lock` and the changed workflow paths when updating action versions. CI and the Pages build use Apple Silicon runners in the organization's `vypdev` group. Each runs the Linux build in a job-specific Docker container and keeps the runner's Docker credentials outside the container. The Pages deployment job uses diff --git a/tests/architecture.test.mjs b/tests/architecture.test.mjs index b7e81f3..1390578 100644 --- a/tests/architecture.test.mjs +++ b/tests/architecture.test.mjs @@ -188,14 +188,19 @@ test('Pages builds only the trusted default branch and grants write permissions }); test('workflows name exact action releases and use GitHub runners for OIDC publication', () => { - const ci = parse(readFileSync('.github/workflows/ci_check.yml', 'utf8')); - const pages = parse(readFileSync('.github/workflows/storybook_pages.yml', 'utf8')); - const npm = parse(readFileSync('.github/workflows/npm_release.yml', 'utf8')); - for (const workflow of [ci, pages, npm]) { - for (const job of Object.values(workflow.jobs)) { - for (const step of job.steps.filter(step => step.uses)) { - expect(step.uses).toMatch(/^[\w/-]+@v[0-9]+\.[0-9]+\.[0-9]+$/u); - } + const ciPath = '.github/workflows/ci_check.yml'; + const pagesPath = '.github/workflows/storybook_pages.yml'; + const npmPath = '.github/workflows/npm_release.yml'; + const ci = parse(readFileSync(ciPath, 'utf8')); + const pages = parse(readFileSync(pagesPath, 'utf8')); + const npm = parse(readFileSync(npmPath, 'utf8')); + const lock = parse(readFileSync('.github/workflows/actions.lock', 'utf8')); + for (const [path, workflow] of [[ciPath, ci], [pagesPath, pages], [npmPath, npm]]) { + const refs = Object.values(workflow.jobs).flatMap(job => job.steps.map(step => step.uses).filter(Boolean)); + expect([...new Set(refs)].sort()).toEqual([...lock.workflows[path]].sort()); + for (const ref of refs) { + expect(ref).toMatch(/^[\w/-]+@v[0-9]+\.[0-9]+\.[0-9]+$/u); + expect(lock.dependencies[ref].commit).toMatch(/^sha1-[a-f0-9]{40}$/u); } } expect(pages.jobs.build['runs-on']).toEqual({group: 'vypdev', labels: ['self-hosted', 'macOS', 'ARM64']});