Skip to content

Follow releases into the README from CI - #33

Merged
abashev merged 1 commit into
mainfrom
readme-follows-releases
Nov 1, 2026
Merged

abashev merged 1 commit into
mainfrom
readme-follows-releases

Conversation

@abashev

@abashev abashev commented Nov 1, 2026

Copy link
Copy Markdown

The README's examples name the plugin's own version (2.27.0.1, six places) and the open-java-format version to add (2.98.0.4, two places, two releases behind 2.98.0.6). Both were changed by hand.

follow-releases.yml runs once an hour, one job per artifact. Each compares the README's version with the latest GitHub release of openjavaformat/<artifact> and, when that release is higher:

  • changes the <version> line after every <artifactId><artifact></artifactId> on the branch follow-releases/<artifact>;
  • opens a pull request for it with BOT_PAT, so that build runs on it;
  • approves it with the workflow's token and turns on squash auto-merge with BOT_PAT, as dependabot-automerge.yml does for Dependabot.

A release that comes out while that pull request is open is force-pushed onto the same branch, and the pull request's title and body follow it. A pull request closed unmerged is not reopened for the same version, only for a newer one. The plugin's own releases start as drafts, so the README moves once a draft is published.

Tested with the step script in catthehacker/ubuntu:act-24.04, a local bare repository as origin and a stand-in gh: the same and an older release, a first pull request, the same release again, a newer release while it is open, one after it was closed, and the plugin's own version. The real token flow runs for the first time after the merge: the first scheduled run should open "Show open-java-format 2.98.0.6 in the README".

The README's examples name the plugin's own version and the
open-java-format version to add, and both were changed by hand: the
formatter one still says 2.98.0.4, two releases behind. The "Follow
releases" workflow now compares each with the latest GitHub release of
openjavaformat/<artifact> once an hour, as the docs and the action
repositories do for the formatter. main takes no direct pushes here, so
instead of committing it changes the README on the branch
follow-releases/<artifact> and opens a pull request for it, approved
with the workflow's token and set to auto-merge, the way Dependabot's
pull requests land.

BOT_PAT pushes the branch, opens the pull request and turns on
auto-merge, because a push or a pull request made with GITHUB_TOKEN
starts no workflow runs, so build would never run on it. mise.toml now
names this workflow among the token's consumers.
@abashev
abashev merged commit 11e4200 into main Nov 1, 2026
8 checks passed
@abashev
abashev deleted the readme-follows-releases branch November 1, 2026 15:31
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.

1 participant