Automate Updates
A repository pinned to a collection’s tag stays there until it moves, so a release does nothing until someone takes it. A scheduled job takes it for you: it moves the pin, runs the checks, and opens a pull request with their verdict.
What the Job Does
-
Find the newest release.
devset update --dry-runnames every release newer than the pin, and the command that takes the newest. A script finds the tag itself:latest=$(git ls-remote --tags --refs --sort=-version:refname https://github.com/acme/profiles 'v*' \ | head -n 1 | sed 's|.*refs/tags/||') -
Take it.
devset update acme --tag "$latest"moves the pin in.devset/config.tomland merges every change with the repository’s edits. -
Take a conflict back. An update that conflicts exits 1 and leaves the conflict in
.devset/conflicts/;devset apply --abortreturns the repository to where it was, and the job reports the release for a person to take by hand, as Update and Resolve Conflicts shows. -
Check. Run the repository’s checks, so the pull request says whether the release passes.
-
Open a pull request with the changes, the release it moved to, and the checks’ verdict.
A cooldown, taking a release only once it is a few days old, leaves time for a bad one to be followed by its fix.
With Atxp
atxp’s github-bump profile is such a job, for every repository that applies
it: once a week, its bump-devset recipe moves each source pinned by tag on
github.com to its newest release three days old or older, and takes a conflict
back; the same run moves the repository’s other pins, runs just check, and
commits the result as one signed commit, to a branch, a pull request, or a merge
once green, as the repository chooses.
By Hand, Across Repositories
To move many repositories at once, run the same steps in each from a tool such as multi-gitter, which opens a pull request per repository.