# Extract Version Bump Logic into Reusable Script This PR extracts the version bump logic from the GitHub Actions workflow (PR #137) into a reusable script and implements the requirements as requested. ## ✅ What This PR Delivers ### 🔧 **Version Bump Script**: `.github/scripts/version-bump.sh` - Extracts all version bump logic from the original workflow - Supports `patch`, `minor`, and `major` version bumps - Configurable base reference for diff comparison (defaults to `origin/main`) - Comprehensive error handling and semantic version validation - Can be used standalone or in workflows ### 🔍 **Version Check Workflow**: `.github/workflows/version-check.yaml` - **Required CI check** that runs on all PRs modifying modules - Verifies that module versions have been properly updated - Fails if versions need bumping but haven't been updated - Provides clear instructions on how to fix version issues ### 🚀 **Version Bump Workflow**: `.github/workflows/version-bump.yaml` - Simplified workflow that uses the extracted script - Triggered by PR labels (`version:patch`, `version:minor`, `version:major`) - Automatically commits version updates and comments on PR ### 📚 **Updated Documentation**: `CONTRIBUTING.md` - Clear instructions on how to use the version bump script - Examples for different bump types - Information about PR labels as an alternative - Explains that CI will check version updates ## 🎯 Key Features ✅ **Script Logic Extracted**: All complex bash logic moved from workflow to reusable script ✅ **Required CI Check**: Version check workflow ensures versions are updated ✅ **Diff Verification**: Script checks git diff to detect modified modules ✅ **Contribution Docs Updated**: Clear instructions for contributors ✅ **Backward Compatible**: Maintains all original functionality ✅ **Error Handling**: Comprehensive validation and clear error messages ## 📖 Usage Examples ```bash # For bug fixes ./.github/scripts/version-bump.sh patch # For new features ./.github/scripts/version-bump.sh minor # For breaking changes ./.github/scripts/version-bump.sh major ``` ## 🔄 Workflow Integration 1. **Developer makes changes** to modules 2. **CI runs version-check** workflow automatically 3. **If versions need updating**, CI fails with instructions 4. **Developer runs script** or adds PR label 5. **Versions get updated** automatically 6. **CI passes** and PR can be merged ## 🧪 Testing The script has been tested with: - ✅ Valid and invalid bump types - ✅ Module detection from git diff - ✅ Version calculation and validation - ✅ README version updates - ✅ Error handling for edge cases This implementation addresses all the original requirements while making the logic more maintainable and reusable. --------- Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com> Co-authored-by: DevelopmentCats <christofer@coder.com>
Coder Registry
Registry Site • Coder OSS • Coder Docs • Official Discord
Coder Registry is a community-driven platform for extending your Coder workspaces. Publish reusable Terraform as Coder Modules for users all over the world.
Note
The Coder Registry repo will be updated to support Coder Templates in the coming weeks. You can currently find all official templates in the official coder/coder repo, under the
examples/templatesdirectory.
Overview
Coder is built on HashiCorp's open-source Terraform language to provide developers an easy, declarative way to define the infrastructure for their remote development environments. Coder-flavored versions of Terraform allow you to mix in reusable Terraform snippets to add integrations with other popular development tools, such as JetBrains, Cursor, or Visual Studio Code.
Simply add the correct import snippet, along with any data dependencies, and your workspace can start using the new functionality immediately.
More information about Coder Modules can be found here, while more information about Coder Templates can be found here.
Getting started
The easiest way to discover new modules and templates is by visiting the official Coder Registry website. The website is a full mirror of the Coder Registry repo, and it is where .tar versions of the various resources can be downloaded from, for use within your Coder deployment.
Note that while Coder has a baseline set of requirements for allowing an external PR to be published, Coder cannot vouch for the validity or functionality of a resource until that resource has been flagged with the verified status. All modules under the Coder namespace are automatically verified.
Getting started with modules
To get started with a module, navigate to that module's page in either the registry site, or the main repo:
In both cases, the main README contains a Terraform snippet for integrating the module into your workspace. The snippet for Cursor looks like this:
module "cursor" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/cursor/coder"
version = "1.0.19"
agent_id = coder_agent.example.id
}
Simply include that snippet inside your Coder template, defining any data dependencies referenced, and the next time you create a new workspace, the functionality will be ready for you to use.
Contributing
We are always accepting new contributions. Please see our contributing guide for more information.
