ci: sync the README Caddy floor with go.mod automatically#21
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow to keep the README’s documented minimum required Caddy version (“Requires Caddy vX.Y.Z or newer”) automatically synced with the github.com/caddyserver/caddy/v2 version in go.mod, including auto-committing back to Dependabot Go modules branches.
Changes:
- Introduces
.github/workflows/readme-sync.ymlto detect Caddy version changes ingo.modand rewrite the README floor sentence. - Adds strict semantic-version validation to avoid pseudo-versions and reduce risk of command injection via the parsed version.
- Automatically commits and pushes the README update back to the triggering branch when needed.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When a PR (Dependabot's or anyone's) changes the Caddy requirement in go.mod, the workflow rewrites the README's 'Requires Caddy vX.Y.Z or newer' note to match and pushes the fix back to the PR branch, so version bumps land with consistent documentation. Runs only on same-repo PR branches that change go.mod - never on main directly - and skips pseudo-versions.
fa30172 to
5803cfc
Compare
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.
Adds a workflow that keeps the README's "Requires Caddy vX.Y.Z or newer" note in lockstep with go.mod.
How it works:
go.modonmainordependabot/go_modules/**branches (plus manual dispatch)maintrigger is a safety net: if a bump ever merges without the sync, the next push corrects itKnown behaviours worth noting:
GITHUB_TOKEN, so it does not retrigger CI on the Dependabot branch (docs-only commit; only matters if required status checks are added later)@dependabot rebasediscards the sync commit and the workflow simply re-adds itpermissions: contents: writeelevates it, which is the documented mechanism