Repository navigation
Follow releases into the README from CI - #33
Merged
Merged
Conversation
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.
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.
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.ymlruns once an hour, one job per artifact. Each compares the README's version with the latest GitHub release ofopenjavaformat/<artifact>and, when that release is higher:<version>line after every<artifactId><artifact></artifactId>on the branchfollow-releases/<artifact>;buildruns on it;dependabot-automerge.ymldoes 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-ingh: 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".