Skip to content

Conversation

Copy link

Copilot AI commented Jan 4, 2026

Automatic Version Bump on Pull Request - Complete ✅

Implementation Summary

  • Analyze the current workflow and version management approach
  • Create a new GitHub Actions workflow to bump version on PR open
  • Implement version bump logic (patch version increment)
  • Update both deno.json and package.json versions
  • Configure workflow to run on pull_request opened event
  • Test the implementation
  • Add proper git configuration and commit/push logic
  • Ensure the workflow has proper permissions to push changes
  • Add documentation for the new workflow
  • Verify workflow file is valid
  • Address code review feedback (robust JSON parsing, validation)
  • Fix shell injection vulnerabilities by passing variables as Deno args
  • Add error handling for missing/malformed files
  • Security scan completed (0 vulnerabilities)

Features Implemented

Robust Version Parsing: Uses Deno's JSON APIs instead of fragile regex/sed
Security: No shell injection vulnerabilities, variables passed safely
Validation: Validates semver format and numeric patch numbers
Error Handling: Clear error messages for missing/malformed files
Dual Updates: Updates both deno.json and package.json
Smart Filtering: Skips bot-created PRs
User Feedback: Adds PR comment confirming version bump

How It Works

  1. Triggers when a PR is opened to master/main
  2. Extracts current version from deno.json (e.g., 0.6.88)
  3. Validates the version is in valid semver format
  4. Increments the patch number (0.6.88 → 0.6.89)
  5. Updates deno.json and package.json with new version
  6. Commits and pushes changes to PR branch
  7. Adds a comment to the PR confirming the bump

This ensures JSR can publish new versions when PRs are merged.

Original prompt

Always bump the version number when a pull request is opened, otherwise updated code won't get uploaded to JSR.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 4, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
adblock-compiler f531980 Jan 04 2026, 04:04 AM

Copilot AI and others added 3 commits January 4, 2026 03:59
Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
@jaypatrick jaypatrick marked this pull request as ready for review January 4, 2026 04:05
@jaypatrick jaypatrick merged commit f182e88 into master Jan 4, 2026
8 checks passed
@jaypatrick jaypatrick deleted the copilot/bump-version-number-on-pr branch January 4, 2026 04:06
Copilot AI requested a review from jaypatrick January 4, 2026 04:06
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