Skip to content

feat: add GitHub Actions workflow for automatic version bumping #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DevelopmentCats
Copy link
Contributor

Version Bump Workflow

Automates module version bumping when PR labels are applied.

Usage

Add one of these labels to a PR:

  • version:patch - Bug fixes (1.2.3 → 1.2.4)
  • version:minor - New features (1.2.3 → 1.3.0)
  • version:major - Breaking changes (1.2.3 → 2.0.0)

What it does

  1. Detects modified modules from PR changes
  2. Gets current version from latest release tag or README
  3. Calculates new version based on label
  4. Updates README versions in module documentation
  5. Commits changes to the PR
  6. Comments summary on the PR

Example

If a PR modifies registry/coder/git-clone/ and has label version:patch:

Current: release/coder/git-clone/v1.0.18
New: v1.0.19
Updates: All versions for git-clone module = "1.0.19" in README

Version Detection

  • Tagged modules: Uses latest release/namespace/module/vX.Y.Z tag
  • Untagged modules: Extracts version from README version = "X.Y.Z"
  • New modules: Start from v1.0.0

Notes

  • Only updates READMEs that contain version references
  • Warns about modules missing proper git tags
  • Requires write permissions on repository

This commit introduces a new workflow that triggers on pull request labeling to automatically detect version bumps (patch, minor, major) for Coder modules. It processes modified modules, updates their version references in README files, and commits the changes. Additionally, it comments on the pull request with a summary of the version bumps and any modules without existing git tags.
@DevelopmentCats DevelopmentCats requested a review from matifali June 5, 2025 01:15
Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

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

Can you extract this to a script in ./scripts/update_veraion.sh that we can reuse in GitHub workflow?

Also the script should be able to run locally and bump versions for individual or multiple modules.

blink-so bot added a commit that referenced this pull request Jun 5, 2025
- Add .github/scripts/version-bump.sh with extracted logic from PR #137
- Add version-check.yaml workflow to verify module versions are updated
- Add version-bump.yaml workflow that uses the script for label-triggered bumps
- Update CONTRIBUTING.md with instructions on using the version bump script
- Script supports patch/minor/major bumps and validates semantic versioning
- CI will now check that module versions are properly updated in PRs
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