Skip to content

ci: sync the README Caddy floor with go.mod automatically#21

Merged
sebdroid merged 2 commits into
mainfrom
chore/readme-floor-sync
Jun 12, 2026
Merged

ci: sync the README Caddy floor with go.mod automatically#21
sebdroid merged 2 commits into
mainfrom
chore/readme-floor-sync

Conversation

@sebdroid

@sebdroid sebdroid commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Adds a workflow that keeps the README's "Requires Caddy vX.Y.Z or newer" note in lockstep with go.mod.

How it works:

  • Triggers on pushes that touch go.mod on main or dependabot/go_modules/** branches (plus manual dispatch)
  • Reads the Caddy version from go.mod, rewrites the README floor sentence if it differs, and pushes the fix back to the same branch - so a Dependabot bump PR gains a matching docs commit automatically
  • The main trigger is a safety net: if a bump ever merges without the sync, the next push corrects it
  • Strict version-format check: refuses to write pseudo-versions into the README and doubles as sed-injection protection

Known behaviours worth noting:

  • The sync commit is made with 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 may stop auto-rebasing a PR once a foreign commit lands on its branch; @dependabot rebase discards the sync commit and the workflow simply re-adds it
  • Dependabot-triggered workflows get a read-only token by default; the workflow-level permissions: contents: write elevates it, which is the documented mechanism

Copilot AI review requested due to automatic review settings June 12, 2026 07:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml to detect Caddy version changes in go.mod and 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.

Comment thread .github/workflows/readme-sync.yml Outdated
Comment thread .github/workflows/readme-sync.yml
sebdroid added 2 commits June 12, 2026 08:59
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.
@sebdroid sebdroid force-pushed the chore/readme-floor-sync branch from fa30172 to 5803cfc Compare June 12, 2026 08:21
@sebdroid sebdroid merged commit 3d36418 into main Jun 12, 2026
5 checks passed
@sebdroid sebdroid deleted the chore/readme-floor-sync branch June 12, 2026 08:25
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.

2 participants