fix(tooling): let self-updates commit, push, and run Validate - #57
Merged
Merged
Conversation
The first self-updates exposed three problems. Installing dependencies switches on a repository's own git hooks, so the bot's push ran the pre-push check, end-to-end tests included, and a template's regenerated tree left prepare-commit-msg pointing at deleted files. And GitHub holds the workflow runs of a pull request a workflow token opened until someone approves them, so the dispatched ci.yml run never counted for the pull request. The bot now commits and pushes with hooks switched off, and approves the held runs its own update started instead of dispatching ci.yml. A run the token may not approve is reported and fails the workflow after the pull request is open. ci.yml no longer needs a workflow_dispatch trigger for updates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Publish self-update fixes for hooks and held workflow runs as a patch release of the shared web standard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
The daily
Standard updateworkflow now finishes on its own: it can commit and push in everyrepository, and its update pull requests get their
Validatecheck without anyone clickingapprove.
Overview of Changes
What the first self-updates showed
v0.5.1 was the first release to reach repositories through their own workflow. labs,
week-without-driving, and
.githubopened their pull requests, but analytics and the three templatesfailed:
In analytics, the bot's
git pushtherefore ran the full pre-push check, end-to-end testsincluded, which can't pass in that job, so the push was rejected.
node_moduleswhile git still pointed at hooksinside it.
prepare-commit-msgruns even with--no-verify, so the commit failed.The pull requests that did open showed a second gap. GitHub now holds the workflow runs of a pull
request that a workflow's own token opened until someone with write access approves them. The
ci.ymlrun the update dispatched did pass. But its check never counted for the pull request, whichstayed blocked until I approved the held runs by hand; labs#41 then merged itself.
The fix
The bot's commit and push run with
core.hooksPath=/dev/null; the hooks are for people. Afteropening its pull request, the update now finds the runs GitHub is holding for that branch and
approves them through the API, instead of dispatching
ci.yml. If the token isn't allowed toapprove them, the workflow says so and fails after the pull request is open, which leaves a
one-click job for a maintainer.
ci.ymlno longer needs aworkflow_dispatchtrigger, so thatrequirement is gone from the drift check and the adoption guide.
Rollout
A repository runs its vendored copy of this code to propose the next release, so analytics and the
templates can't apply 0.5.2 on their own. I'll apply it once to those four with the maintainer
script; everything after that is automatic. labs, week-without-driving, and
.githubpick it upfrom their daily run, and that run is the first test of whether a workflow token may approve its
own held runs.
Testing
pnpm checkpasses. The proposal tests now cover:Follow-ups
and have
Standard statuspoint maintainers at waiting pull requests.🤖 Generated with Claude Code