Skip to content

Pin third-party actions, uv, and pre-commit hooks to commits and checksums - #1463

Merged
max-sixty merged 6 commits into
mainfrom
pin-action-shas
Sep 30, 2026
Merged

max-sixty merged 6 commits into
mainfrom
pin-action-shas

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A tag is a pointer its publisher can move, and a major tag like @v7 moves to every v7.x release without a tend release. The composite actions run actions/cache and actions/upload-artifact in the job that sets up the credential proxy, and the generated workflows stamp actions/checkout and astral-sh/setup-uv into every consumer. The uv that launches the proxy came from astral.sh/uv/<version>/install.sh, fetched live.

Actions. Every third-party uses: — composite actions, generator templates, hand-maintained workflows, .config/tend.yaml — is now owner/repo@<sha> # vX.Y.Z, at the latest release each major pointed to. test_third_party_actions_are_pinned_by_sha rejects any other shape and allows one pin per action. This reverses the sweep's old policy of accepting a floating major as current.

uv. shared/steps/install-uv.sh downloads the release archive and checks it against a sha256 committed per arch (x86_64, aarch64), which also makes it the uv version's one home. The uv_version input goes: overriding it could only fail the checksum. The proxy cache key hashes uv.lock together with the script. The generated workflows' setup-uv gets the same sha256s through its checksum input; setup-uv 10.2.0's built-in table predates uv 0.12.19, so without it the checksum came from a manifest fetched at job time. UV_VERSION/UV_SHA256 in workflows.py are asserted equal to the script's.

pre-commit. Hook revs are frozen at their current versions in pre-commit's --freeze format, and a test rejects a hook added by tag.

Weekly sweep (.claude/skills/running-tend/SKILL.md): resolves each new release to its commit, flags a tag that moved off its pinned commit, and runs pre-commit autoupdate --freeze.

Dependabot can bump refs in this format (it rewrites the SHA and the trailing version comment), but it reads only .github/workflows/ and action.yml files, not the generator's templates or the uv checksums, so the sweep stays the one bumping mechanism. Consumers whose Dependabot watches github-actions will now also see patch bumps for the generated checkout pin, as they already do for setup-uv; nightly regeneration overwrites them.

Tested: install-uv.sh run as a non-root user with PATH=/usr/bin:/bin in Ubuntu 24.04 containers on arm64 and amd64 installs uv 0.12.19, and refuses a corrupted checksum.

This was written by Claude Code on behalf of max-sixty

🤖 Generated with Claude Code

max-sixty and others added 6 commits September 29, 2026 14:49
The proxy ran `uvx --from mitmproxy==X`, which pinned mitmproxy alone: its
transitive dependencies (cryptography, h2, ...) resolved from PyPI in every
consumer job, inside the process that holds the real PAT and model credential.

Move mitmproxy into a root `proxy` dependency group and run it with
`uv run --project <action root> --frozen --no-build --only-group proxy`, so
the job installs exactly the locked closure, hash-checked, and tests run
against the same versions. The `mitmproxy_version` input goes: the lock is
the one home. Restricted mode keeps its uv cache, now keyed on the lock's
hash and the uv version.

Also set DISABLE_AUTOUPDATER in the agent env, so the pinned `claude` can't
background-update onto a newer release mid-job.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A tag is a pointer its publisher can move, and a major tag like `@v7` moves
to every v7.x release without a tend release. Every third-party `uses:` in
the composite actions, the generator templates, and the hand-maintained
workflows is now `owner/repo@<sha> # vX.Y.Z`, taken from the latest release
each major pointed at. `test_third_party_actions_are_pinned_by_sha` enforces
the shape and one pin per action.

install-uv.sh no longer runs astral.sh's installer script fetched live: it
downloads the release archive and checks it against a sha256 committed per
arch, which also makes the script the uv version's one home. The `uv_version`
input goes, since overriding it could only fail the checksum. The generated
workflows' setup-uv gets the same sha256s through its `checksum` input;
without it, setup-uv 10.2.0 takes the checksum from a manifest it fetches at
job time, because its built-in table predates uv 0.12.19.

The weekly sweep now resolves each release to its commit and flags a tag that
moved off its pinned commit.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Hook repos are fetched by tag, which the publisher can move, and they run on
every developer machine and in CI. The revs keep their current versions in
pre-commit's `--freeze` format, the weekly sweep's autoupdate passes
`--freeze` so bumps stay SHAs, and a test rejects a hook added by tag.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	.claude/skills/running-tend/SKILL.md
#	.github/workflows/ci.yaml
#	claude/action.yaml
#	codex/action.yaml
#	proxy/test-setup-sandbox.sh
@max-sixty
max-sixty merged commit 64fb62a into main Sep 30, 2026
14 checks passed
@max-sixty
max-sixty deleted the pin-action-shas branch September 30, 2026 00:52
max-sixty pushed a commit that referenced this pull request Sep 30, 2026
Regenerates the workflows with the same tend version (0.3.5) to pick up
a `setup:` change in `.config/tend.yaml`. #1463 pinned
`astral-sh/setup-uv` there to commit
`c18668ad3cf93ea998bef934396af7bb5c839dc7` (v10.2.0) instead of the
`v10.2.0` tag, but the committed `tend-*.yaml` files were stamped before
that and still reference the tag. Each of the eight workflows changes by
that one `uses:` line; the action version they run is the same.

The generator renders `setup:` steps from parsed config, so the `#
v10.2.0` comment next to the SHA in `.config/tend.yaml` doesn't carry
into the generated files. `test_third_party_actions_are_pinned_by_sha`
excludes the generated `tend-*.yaml` files, so it doesn't need that
comment there.

Co-authored-by: tend-agent <[email protected]>
max-sixty pushed a commit to max-sixty/worktrunk that referenced this pull request Oct 4, 2026
Regenerates the Tend workflows with tend 0.3.7 (from 0.3.5). The effect
for this repo: the generated workflows now pin third-party actions and
`uv` to commits and checksums, and the bot's sessions pick up
0.3.6–0.3.7's skill and runner fixes. No `.config/tend.yaml` change was
needed.

What changes for worktrunk:

- **Supply-chain pinning** — `actions/checkout` and `astral-sh/setup-uv`
are pinned to commit SHAs (version kept as a comment), and the `uv`
download (bumped to 0.12.22) is verified against a per-arch checksum
(max-sixty/tend#1463).
- **Mention prompt moves into a skill** — `tend-mention` now invokes
`/tend-ci-runner:mention` and passes only the triggering event; the
per-event "read the context, respond, make changes" instructions that
were inlined in the workflow now live in the skill.
- **`fetch-tags: true` is dropped from checkouts.** Every Tend checkout
uses `fetch-depth: 0`, which already fetches all tags, so `build.rs`'s
`git describe` still sees them.
- **CI polling no longer waits on a job held for environment approval**
(max-sixty/tend#1473), and nightly reads the last successful run more
robustly so a cached listing can't widen its review range
(max-sixty/tend#1468).
- **Triage opens a PR when a maintainer is reasonably likely to merge
it** rather than defaulting to a comment (max-sixty/tend#1471), and
repair sessions resume unfinished bot work from the live PR state
(max-sixty/tend#1479).
- Claude Code is bumped to 2.1.288 (max-sixty/tend#1491).

Full upstream diff:
max-sixty/tend@0.3.5...0.3.7

Co-authored-by: worktrunk-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants