Repository navigation
feat: open a pull request when the standard has moved - #62
Merged
Merged
Conversation
A new standard reached a repository only when someone ran repokeeper update in it: twelve repositories meant twelve runs and twelve commits by hand. modules.autoupdate (off unless asked for, GitHub only) writes a weekly workflow that runs repokeeper update with the newest repokeeper and, when that changes anything, pushes the branch repokeeper/update and opens a pull request; a later run moves the same branch and edits the same pull request. The work is in a new reusable workflow, repokeeper-update.yml. What the pull request holds is what the command writes by hand: files edited locally are kept and named in the body, with a warning on the run instead of a failure. A package.json the update changes has its package-lock.json brought in step, so npm ci still installs. An update usually changes a workflow file, which GITHUB_TOKEN may not push, so the job takes a REPOKEEPER_TOKEN secret; without one it falls back to GITHUB_TOKEN, says why a refused push failed, and has the held runs of its pull request approved as the release job does. The switch is written to .repokeeper.yml only when on, so a file without it stays readable by every earlier repokeeper.
Pushed from a linked worktree, the pre-push hook runs the suite with GIT_DIR and GIT_WORK_TREE pointing at this repository, so every git init a test makes in a scratch directory wrote into it instead: 72 tests failed there and passed everywhere else. A setup file drops those variables before any test runs.
vannt-dev
force-pushed
the
feat/update-pr
branch
from
October 12, 2026 15:42
76e40c2 to
29fb689
Compare
This was referenced Oct 13, 2026
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.
Why
A new standard reaches a repository only when someone runs
repokeeper updatein it. With twelve repositories that was twelve runs and twelve commits by hand on 11 October, and it comes back with every standard.What changes
modules.autoupdate: true(off unless asked for, in no preset, GitHub only) writes.github/workflows/repokeeper-autoupdate.yml: every Monday, and by hand, it calls the new reusable workflowrepokeeper-update.yml, whichrepokeeper updatewith the newest repokeeper;repokeeper/updateand openschore(repokeeper): update standard to X.Y.Z; a later run moves the same branch and edits the same pull request;What the pull request holds is what the command writes by hand:
ownedones, are kept.repokeeper updateexits 1 for kept files; the job takes that as a warning, not a failure, and the body of the pull request carries the update's report, which names them.package.jsonthe update changes has itspackage-lock.jsonbrought in step, sonpm cistill installs. With pnpm, Yarn or Bun the body says the lockfile is still to be updated.Token. An update usually changes a file under
.github/workflows/, whichGITHUB_TOKENmay not push, so the job takes aREPOKEEPER_TOKENsecret (contents, pull requests and workflows, read and write). Without itGITHUB_TOKENis used: it can propose an update that touches no workflow file, a refused push says why, and the held runs of its pull request are approved by anupdate-pr-cijob, asrelease-pr-cidoes for releases.Compatibility. The switch is written to
.repokeeper.ymlonly when on, so a file without it is still read by every earlier repokeeper, and the playground (published at merge) keeps producing files 0.8.2 accepts unless the new box is ticked, in which case it says that 0.9.0 is needed. No generated file of an existing repository changes, so the standard version stays 1.4.4.On GitLab the switch writes nothing and
check/updatesay so. A scheduled job that opens a merge request needs a project token and was not built, because it could not be tried here.Checked
434 tests (4 new for the module, written first; the interactive
inittests now ask the new question and take a yes),biome check, typecheck, build.The reusable workflow's step, run outside GitHub against a repository made with the published 0.8.0 (standard 1.4.3), a bare repository as its origin and a stand-in for
gh:ci.yml,.repokeeper.yml, the lock,package.jsonandpackage-lock.json;npm cion the branch passes;gh pr create;changed=true,pr_branchsetgh pr edit 7; nopr_branchchanged=false, noghcallchanged=false, exit 0REPOKEEPER_TOKENThe built CLI in a scratch repository:
initwrites noautoupdateline; switching it on and runningupdatewrites the workflow, andcheckthen passes; withplatform: gitlabthe note is printed.Not run: the workflow on GitHub itself (the scheduled trigger, the real
ghcalls, the approval of held runs). The reusable workflow only exists at@v0after a release, so the first real run is in a repository that switches it on after 0.9.0.A second commit: the tests and git's hook environment
test: keep git's hook environment away from the tests. Pushed from a linked worktree, the pre-push hook runs the suite withGIT_DIRandGIT_WORK_TREEpointing at this repository, and the tests' owngit init,git configandgit committhen act on it instead of on their scratch directories: 72 tests fail, and the repository gets their commits and settings. That happened here while this branch was first pushed (the branch was rebuilt and the settings removed; nothing else was touched).test/setup.tsdrops those variables before any test runs; with it the suite passes under the hook's environment and leaves the repository alone.