Skip to content

Automate package.json version bumping in release workflow#190

Merged
bartveneman merged 1 commit intomainfrom
claude/automate-release-process-jgVvy
Mar 18, 2026
Merged

Automate package.json version bumping in release workflow#190
bartveneman merged 1 commit intomainfrom
claude/automate-release-process-jgVvy

Conversation

@bartveneman
Copy link
Member

Summary

Updated the NPM publish workflow to automatically bump the version in package.json when a release is created, ensuring the published package version matches the git release tag.

Key Changes

  • Updated permissions to allow writing to repository contents (required for pushing commits)
  • Removed outdated workflow comments
  • Added automated version bumping step that extracts version from release tag and updates package.json
  • Added commit and push step to persist version changes back to the main branch using GitHub Actions bot credentials
  • Version bump occurs before the build and publish steps to ensure consistency

Implementation Details

  • Version is extracted from github.event.release.tag_name and the v prefix is stripped before applying to npm version command
  • Uses npm version with --no-git-tag-version flag to update version without creating duplicate git tags
  • Commits both package.json and package-lock.json to maintain lockfile consistency
  • Pushes changes directly to main branch after release creation

https://claude.ai/code/session_01CAvVi3i1zrJrf1B7KsRj8o

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.23%. Comparing base (0832959) to head (595489f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #190   +/-   ##
=======================================
  Coverage   95.23%   95.23%           
=======================================
  Files          16       16           
  Lines        2874     2874           
  Branches      806      806           
=======================================
  Hits         2737     2737           
  Misses        137      137           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bartveneman bartveneman marked this pull request as ready for review March 18, 2026 12:12
@bartveneman bartveneman merged commit 5c5383f into main Mar 18, 2026
4 of 5 checks passed
@bartveneman bartveneman deleted the claude/automate-release-process-jgVvy branch March 18, 2026 12:12
@codecov-commenter
Copy link

Bundle Report

Bundle size has no change ✅

bartveneman pushed a commit to projectwallace/format-css that referenced this pull request Mar 18, 2026
Automatically update package.json and package-lock.json version
whenever a GitHub release is created, using the release tag name.
Uses npm version --no-git-tag-version to avoid duplicate tags.

Implements projectwallace/css-parser#190
bartveneman pushed a commit to projectwallace/color-sorter that referenced this pull request Mar 18, 2026
Extracts version from the GitHub release tag (stripping the 'v' prefix),
applies it to package.json via 'npm version --no-git-tag-version', commits
both package.json and package-lock.json, and pushes before building and
publishing to npm.

Based on projectwallace/css-parser#190
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