ci: auto bump patch version on PR-merge to develop - #171
Merged
Conversation
Adds .github/workflows/bump-develop.yml: on pull_request closed+merged into develop, bumps the patch component in Cargo.toml + Cargo.lock (codesearch package version only, targeted sed) and pushes as github-actions[bot]. Concurrency serializes rapid merges. Implements the versioning scheme: Major.Minor.Incr where Incr +=1 per merged PR (auto) and Minor +=1 at release (manual via scripts/bump-version.sh --type minor, resets Incr to 0). Release flow unchanged: minor-bump on release branch -> PR develop->master -> tag -> build from master. Requires a CI_PAT Actions secret (fine-grained PAT owned by the bypass-eligible repo owner, Contents:write) because the block-develop ruleset blocks the default GITHUB_TOKEN. See workflow header comment for setup. Also fixes .gitignore: the blanket .*/ rule was silently ignoring .github/ (only .githooks was exempted), so new workflow files under .github/ could not be added. Adds the matching !.github/ exception.
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.
What
Adds
.github/workflows/bump-develop.yml: when a PR is closed+merged intodevelop, automatically bumps the patch component (Major.Minor.Incr→Incr += 1) inCargo.tomland the matchingcodesearchpackage entry inCargo.lock, then pushes the commit asgithub-actions[bot].Versioning scheme implemented
Incr(patch) +1 (auto, this workflow)Minor+1,Incr→ 0 (manual:scripts/bump-version.sh --type minor, on the release branch before the tag)Major(manual)Release flow unchanged: minor-bump → PR
develop→master→ tag master →release.ymlbuilds from the tag.Why a PAT (
CI_PAT), notGITHUB_TOKENThe "block develop" ruleset (pull_request review required) blocks the default
GITHUB_TOKEN(separate bot identity, no bypass role). A fine-grained PAT owned by the bypass-eligible repo owner authenticates as the owner, so it inherits the bypass and can push the bump commit.Setup (repo owner, do NOT paste tokens into chat/PRs):
flupkede, repository access = All repositories (or this repo), permission Contents: Read and write.CI_PAT(Settings → Secrets → Actions).concurrencyserializes the bump job, so N rapid merges produce N sequential bumps (never a lost update).Also fixes
.gitignoreThe blanket
.*\/rule was silently ignoring.github/(only.githooks/was exempted), so any new file under.github/(e.g. this workflow) could not begit add-ed. Adds the matching!.github/exception — same pattern as the existing.githooks/exemption. This was a latent footgun for all future workflow/config additions.Validation
cargo fmt --check,cargo check,cargo clippy,cargo test --lib(609 passed; 0 failed).Cargo.toml+Cargo.lock:1.1.31 → 1.1.32on exactly thecodesearchversion line (Cargo.toml L3 + Cargo.lock L632); 0 of the other 618 version lines touched; verify-greps pass.yaml.safe_load).Not bundled (separate follow-ups)
release.ymlworkflow_dispatchcheckout has noref:→ manual dispatch builds master-tip but labels the Release with the typed version (mismatch). Likely related to missing macos binary in v1.1.31 #161.RELEASING.mdsays "Squash merge all PRs" / "Create PR → develop. Squash merge." — wrong: feature→develop uses merge commits; onlydevelop→masterrelease PRs are squash. AGENTS.md is correct.cargo fmtonly).