Skip to content

fix: port conventional-commit version bump from metriccalc - #4

Merged
monazhu merged 1 commit into
mainfrom
ci/port-version-bump
Aug 11, 2026
Merged

monazhu merged 1 commit into
mainfrom
ci/port-version-bump

Conversation

@monazhu

@monazhu monazhu commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Ports the working CI setup from c3d-metriccalc (DS-980 / DS-981) so R-package version management is consistent across our R repos.

Changes

version-bump.yaml — replaces the manual workflow_dispatch bump, which pushed directly to protected main and failed every run (version has been stuck at 0.1.0):

  • Bump type derived from conventional commits on push to main (feat!:/BREAKING CHANGE → major, feat: → minor, fix:/perf:/refactor: → patch).
  • Opens a chore/bump-version-* PR and enables auto-merge (merge commit, never squash) — main requires one approving review from a project member since this repo is public, so the bump PR lands once someone approves.
  • Force-pushes the bump branch and skips PR creation if one is already open, so failed runs don't wedge it.
  • New tag job: once the bump PR's merge commit lands on main, tags v<version> (preserves the old workflow's tagging behavior).

R-CMD-check.yaml — deduped to match metriccalc:

  • pull_request-only trigger (every change reaches main through a PR, so the push trigger double-ran checks).
  • Skips chore/bump-version-* PRs — they only touch the DESCRIPTION version string.

Deployment notes

  • Reuses the VERSION_BUMP_TOKEN secret, updated to the fine-grained PAT used by metriccalc (needs Contents R/W + Pull requests R/W and repo access to this repo).
  • Repo settings: allow_auto_merge and delete_branch_on_merge enabled alongside this PR.

🤖 Generated with Claude Code

Replace the manual workflow_dispatch bump (which pushed directly to
protected main and always failed) with metriccalc's PR-based flow:
bump type derived from conventional commits, bump lands via an
auto-merge PR (main requires one approving review), release tagged
once the bump merge hits main. R-CMD-check now runs on pull_request
only and skips bump PRs.
@monazhu
monazhu force-pushed the ci/port-version-bump branch from 1fb313b to 7c29d22 Compare August 11, 2026 22:44
@monazhu monazhu changed the title ci: port conventional-commit version bump from metriccalc fix: port conventional-commit version bump from metriccalc Aug 11, 2026
@monazhu
monazhu requested review from nccanderson and a lite review from Copilot August 11, 2026 23:11

@nccanderson nccanderson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

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

Ports a CI-driven version-bump workflow (based on conventional commits) to keep the R package DESCRIPTION version and release tags consistent across R repositories, and aligns the R CMD check workflow triggers with that flow.

Changes:

  • Replaces the manual version bump dispatch with an automatic bump PR flow on pushes to main, deriving bump type from conventional commit messages.
  • Adds an automated tagging job intended to tag v<version> once the bump PR merge commit lands on main.
  • Adjusts R-CMD-check to run only on pull_request and skip version-bump PRs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/version-bump.yaml Adds automated conventional-commit-based version bump PR creation and post-merge tagging.
.github/workflows/R-CMD-check.yaml Removes push trigger and skips running checks on automated bump PRs.
Suppressed comments (1)

.github/workflows/version-bump.yaml:112

  • git ls-remote patterns match full ref names (e.g., refs/tags/v1.2.3). Using just v${VERSION} will not reliably detect an existing tag, so re-runs may try to recreate an existing tag and fail on push.
          if ! git ls-remote --exit-code --tags origin "v${VERSION}" >/dev/null; then

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

id: bump
run: |
# Get commit messages from this push
COMMITS=$(git log --format="%s" ${{ github.event.before }}..${{ github.event.after }})
@monazhu
monazhu merged commit 9d220f8 into main Aug 11, 2026
6 checks passed
@monazhu
monazhu deleted the ci/port-version-bump branch August 11, 2026 23:29
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.

3 participants