Skip to content

Commit e93bf1d

Browse files
chore(ci): key actions.lock by the SHA the workflows actually name
The previous attempt used `gh actions-lock --relock`. That flag does not mean "regenerate" — it means "bump moved branch/version refs to their current upstream SHA", so it re-resolved everything to latest and wrote a lockfile keyed by TAG (`actions/checkout@v7.0.1`) while every workflow in this repo names a SHA (`actions/checkout@3d3c42e5... # v7.0.1`). That shape contradicts the estate's validator, which keys on `owner/repo@<40- hex>` exactly as written and sub-path-normalised (`github/codeql-action/ init@X` is keyed once as `github/codeql-action@X`). GitHub rejected the lot at startup: The lockfile could not be validated. Regenerate it by running `gh actions-lock`. Measured against hyperpolymath/standards .githooks/validate-actions-lock.sh: the lockfile on main is missing 10 of the 14 required SHA keys. This one is missing none — 16 SHA-pinned refs checked, 16 lockfile keys, 0 errors. The workflow now regenerates with plain fix mode plus --no-migrate-local-actions --no-narrow, which is the canonical invocation, and refuses to let a regeneration rewrite the workflow files underneath it. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
1 parent 78ffe83 commit e93bf1d

2 files changed

Lines changed: 77 additions & 51 deletions

File tree

‎.github/workflows/actions-lock.yml‎

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,18 @@ jobs:
199199
set -euo pipefail
200200
gh extension install github/gh-actions-lock --pin "$ACTIONS_LOCK_EXTENSION_VERSION"
201201
202+
# NOT --relock. --relock means "bump moved branch/version refs to their
203+
# current upstream SHA", so it upgrades every ref to latest and writes a
204+
# lockfile keyed by TAG — which is the wrong shape for a repo whose
205+
# workflows are SHA-pinned. The estate's validator keys on
206+
# `owner/repo@<40-hex>` exactly as written in the workflow, so a
207+
# tag-keyed lockfile contradicts every workflow in the repo and GitHub
208+
# rejects the lot at startup with "The lockfile could not be validated."
209+
#
210+
# Plain fix mode with --no-migrate-local-actions --no-narrow is the
211+
# canonical regeneration: it keys each entry by the ref the workflow
212+
# actually names. See hyperpolymath/standards
213+
# .githooks/validate-actions-lock.sh.
202214
- name: Regenerate the lockfile
203215
id: regenerate
204216
env:
@@ -207,7 +219,8 @@ jobs:
207219
set -uo pipefail
208220
set +e
209221
code=0
210-
gh actions-lock --relock --no-interactive >relock.out 2>relock.err || code=$?
222+
gh actions-lock --no-migrate-local-actions --no-narrow --no-interactive \
223+
>relock.out 2>relock.err || code=$?
211224
cat relock.out || true
212225
cat relock.err || true
213226
# A non-zero exit here does NOT mean nothing was written. The tool
@@ -216,11 +229,24 @@ jobs:
216229
# invalidate the file. "The file did not change" is the real
217230
# failure, and that is checked below.
218231
if [ "$code" -ne 0 ]; then
219-
echo "::warning::gh actions-lock --relock exited ${code}; the regenerated lockfile is still delivered if it changed"
232+
echo "::warning::gh actions-lock exited ${code}; the regenerated lockfile is still delivered if it changed"
220233
while IFS= read -r line; do
221234
if [ -n "$line" ]; then echo "::warning::[gh actions-lock] ${line}"; fi
222235
done < <(tail -n 30 relock.err | tr -d '\r' | cut -c1-200)
223236
fi
237+
238+
# Regenerating the lockfile must not rewrite the workflows. If it
239+
# did, the file it just wrote describes a tree that is not on disk —
240+
# name the files, then put them back and keep only the lockfile.
241+
touched="$(git status --porcelain -- '.github/workflows/*.yml' '.github/workflows/*.yaml' || true)"
242+
if [ -n "$touched" ]; then
243+
echo "::warning::gh actions-lock modified workflow files while regenerating the lockfile; they have been reverted and only actions.lock is kept"
244+
while IFS= read -r line; do
245+
if [ -n "$line" ]; then echo "::warning::[workflow touched] ${line}"; fi
246+
done <<< "$touched"
247+
git checkout -- .github/workflows || true
248+
fi
249+
224250
if git diff --quiet -- .github/workflows/actions.lock; then
225251
echo "changed=false" >> "$GITHUB_OUTPUT"
226252
echo "::error::gh actions-lock produced no change to actions.lock — the branch stays unstartable and the file must be regenerated by hand"

‎.github/workflows/actions.lock‎

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,57 @@
44
version: 'v0.0.2'
55
workflows:
66
'.github/workflows/abi-contract.yml':
7-
- 'actions/checkout@v7.0.1'
7+
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
88
'.github/workflows/actions-lock.yml':
9-
- 'actions/checkout@v7.0.1'
10-
- 'actions/upload-artifact@v7.0.1'
9+
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
10+
- 'actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a'
1111
'.github/workflows/boj-build.yml':
12-
- 'actions/checkout@v7.0.1'
12+
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
1313
'.github/workflows/casket-pages.yml':
14-
- 'actions/cache@v6.1.0'
15-
- 'actions/checkout@v7.0.1'
16-
- 'actions/configure-pages@v6.0.0'
17-
- 'actions/deploy-pages@v5.0.1'
18-
- 'actions/upload-pages-artifact@v5.0.0'
14+
- 'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9'
15+
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
16+
- 'actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d'
17+
- 'actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346'
18+
- 'actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9'
1919
'.github/workflows/codeql.yml':
20-
- 'actions/checkout@v7.0.1'
21-
- 'github/codeql-action@v4.38.2'
20+
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
21+
- 'github/codeql-action@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2'
2222
'.github/workflows/cross-platform.yml':
23-
- 'actions/cache@v6.1.0'
24-
- 'actions/checkout@v7.0.1'
23+
- 'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9'
24+
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
2525
'.github/workflows/dogfood-gate.yml':
26-
- 'actions/checkout@v7.0.1'
27-
- 'hyperpolymath/deed-ecosystem@main'
28-
- 'hyperpolymath/k9-ecosystem@main'
26+
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
27+
- 'hyperpolymath/deed-ecosystem@3e69929a4b0b5610b477732ee125a156cbc8a040'
28+
- 'hyperpolymath/k9-ecosystem@20f6be5b5a14a48680b236955b5c4ad9033d00d4'
2929
'.github/workflows/governance.yml': []
3030
'.github/workflows/hypatia-scan.yml':
31-
- 'actions/checkout@v7.0.1'
32-
- 'actions/github-script@v9.0.0'
33-
- 'actions/upload-artifact@v7.0.1'
34-
- 'erlef/setup-beam@v1.24.1'
35-
- 'github/codeql-action@v4.38.2'
31+
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
32+
- 'actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3'
33+
- 'actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a'
34+
- 'erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124'
35+
- 'github/codeql-action@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2'
3636
'.github/workflows/instant-sync.yml': []
3737
'.github/workflows/label-triage.yml': []
3838
'.github/workflows/labels.yml': []
3939
'.github/workflows/mirror.yml': []
4040
'.github/workflows/push-email-notify.yml':
41-
- 'hyperpolymath/smtp-notify-action@v0.3.0'
41+
- 'hyperpolymath/smtp-notify-action@22e7bdb322c430c1d0dac6b3bb307f4bb139d0be'
4242
'.github/workflows/release.yml':
43-
- 'actions/attest-build-provenance@v4.2.2'
44-
- 'actions/checkout@v7.0.1'
45-
- 'actions/download-artifact@v8.0.1'
46-
- 'actions/upload-artifact@v7.0.1'
43+
- 'actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8'
44+
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
45+
- 'actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c'
46+
- 'actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a'
4747
'.github/workflows/rhodibot.yml':
48-
- 'actions/checkout@v7.0.1'
48+
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
4949
'.github/workflows/scorecard.yml': []
5050
'.github/workflows/secret-scanner.yml': []
5151
'.github/workflows/static-analysis-gate.yml':
52-
- 'actions/checkout@v7.0.1'
53-
- 'actions/download-artifact@v8.0.1'
54-
- 'actions/upload-artifact@v7.0.1'
55-
- 'erlef/setup-beam@v1.24.1'
52+
- 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1'
53+
- 'actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c'
54+
- 'actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a'
55+
- 'erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124'
5656
dependencies:
57-
'actions/attest-build-provenance@v4.2.2':
57+
'actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8':
5858
ref: 'v4.2.2'
5959
commit: 'sha1-4d101475d8b20a2381f78447822ac1eab6504dd8'
6060
owner_id: 44036562
@@ -66,74 +66,74 @@ dependencies:
6666
commit: 'sha1-508db95dd578ae2727ebd6217d5ba78e4fbda05d'
6767
owner_id: 44036562
6868
repo_id: 760701061
69-
'actions/cache@v6.1.0':
69+
'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9':
7070
ref: 'v6.1.0'
7171
commit: 'sha1-55cc8345863c7cc4c66a329aec7e433d2d1c52a9'
7272
owner_id: 44036562
7373
repo_id: 215566462
74-
'actions/checkout@v7.0.1':
74+
'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1':
7575
ref: 'v7.0.1'
7676
commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
7777
owner_id: 44036562
7878
repo_id: 197814629
79-
'actions/configure-pages@v6.0.0':
79+
'actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d':
8080
ref: 'v6.0.0'
8181
commit: 'sha1-45bfe0192ca1faeb007ade9deae92b16b8254a0d'
8282
owner_id: 44036562
8383
repo_id: 513659658
84-
'actions/deploy-pages@v5.0.1':
84+
'actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346':
8585
ref: 'v5.0.1'
8686
commit: 'sha1-368f82528645a54fb793d4d04e342629a3f51346'
8787
owner_id: 44036562
8888
repo_id: 438112499
89-
'actions/download-artifact@v8.0.1':
89+
'actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c':
9090
ref: 'v8.0.1'
9191
commit: 'sha1-3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c'
9292
owner_id: 44036562
9393
repo_id: 192626254
94-
'actions/github-script@v9.0.0':
94+
'actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3':
9595
ref: 'v9.0.0'
9696
commit: 'sha1-3a2844b7e9c422d3c10d287c895573f7108da1b3'
9797
owner_id: 44036562
9898
repo_id: 205262760
99+
'actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a':
100+
ref: 'v7.0.1'
101+
commit: 'sha1-043fb46d1a93c77aae656e7c1c64a875d1fc6a0a'
102+
owner_id: 44036562
103+
repo_id: 192625955
99104
'actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f':
100105
ref: 'v7.0.0'
101106
commit: 'sha1-bbbca2ddaa5d8feaa63e36b76fdaad77386f024f'
102107
owner_id: 44036562
103108
repo_id: 192625955
104-
'actions/upload-artifact@v7.0.1':
105-
ref: 'v7.0.1'
106-
commit: 'sha1-043fb46d1a93c77aae656e7c1c64a875d1fc6a0a'
107-
owner_id: 44036562
108-
repo_id: 192625955
109-
'actions/upload-pages-artifact@v5.0.0':
109+
'actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9':
110110
ref: 'v5.0.0'
111111
commit: 'sha1-fc324d3547104276b827a68afc52ff2a11cc49c9'
112112
owner_id: 44036562
113113
repo_id: 496012378
114114
uses:
115115
- 'actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f'
116-
'erlef/setup-beam@v1.24.1':
116+
'erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124':
117117
ref: 'v1.24.1'
118118
commit: 'sha1-54075bcc5e249e4758d363f27d099f55d843f124'
119119
owner_id: 47606891
120120
repo_id: 331103973
121-
'github/codeql-action@v4.38.2':
121+
'github/codeql-action@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2':
122122
ref: 'v4.38.2'
123123
commit: 'sha1-2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2'
124124
owner_id: 9919
125125
repo_id: 259445878
126-
'hyperpolymath/deed-ecosystem@main':
126+
'hyperpolymath/deed-ecosystem@3e69929a4b0b5610b477732ee125a156cbc8a040':
127127
ref: 'main'
128128
commit: 'sha1-3e69929a4b0b5610b477732ee125a156cbc8a040'
129129
owner_id: 6759885
130130
repo_id: 1275649586
131-
'hyperpolymath/k9-ecosystem@main':
131+
'hyperpolymath/k9-ecosystem@20f6be5b5a14a48680b236955b5c4ad9033d00d4':
132132
ref: 'main'
133133
commit: 'sha1-20f6be5b5a14a48680b236955b5c4ad9033d00d4'
134134
owner_id: 6759885
135135
repo_id: 1275650185
136-
'hyperpolymath/smtp-notify-action@v0.3.0':
136+
'hyperpolymath/smtp-notify-action@22e7bdb322c430c1d0dac6b3bb307f4bb139d0be':
137137
ref: 'v0.3.0'
138138
commit: 'sha1-22e7bdb322c430c1d0dac6b3bb307f4bb139d0be'
139139
owner_id: 6759885

0 commit comments

Comments
 (0)