Skip to content

Implement GitHub release creation in CI workflow#730

Merged
bourgeoa merged 1 commit intomainfrom
github-release
Mar 30, 2026
Merged

Implement GitHub release creation in CI workflow#730
bourgeoa merged 1 commit intomainfrom
github-release

Conversation

@bourgeoa
Copy link
Copy Markdown
Contributor

Add GitHub release step to CI workflow for versioned releases.

Add GitHub release step to CI workflow for versioned releases.
Copilot AI review requested due to automatic review settings March 30, 2026 14:38
@bourgeoa bourgeoa enabled auto-merge March 30, 2026 14:38
@bourgeoa bourgeoa merged commit 207ae79 into main Mar 30, 2026
4 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds automated GitHub Release creation to the CI workflow so that pushes to main can produce a versioned GitHub release after a successful npm publish.

Changes:

  • Introduces a new github-release job gated to push events on main.
  • Computes the release tag from package.json version and creates the release with generated notes, skipping if the release already exists.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +117 to +121
echo "Tag $TAG already exists on origin. Creating release from existing tag."
gh release create "$TAG" --verify-tag --generate-notes
else
echo "Creating tag and release $TAG from commit $GITHUB_SHA."
gh release create "$TAG" --target "$GITHUB_SHA" --generate-notes
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

When the tag already exists on origin, this creates the release from that tag without confirming it points to the same commit that was just published to npm. If refs/tags/$TAG targets a different commit than $GITHUB_SHA, this can produce a GitHub release whose code/release notes don’t match the published package. Consider verifying the tag’s target commit matches $GITHUB_SHA (and failing if it doesn’t) before creating the release.

Copilot uses AI. Check for mistakes.
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="v$(node -p "require('./package.json').version")"
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

The TAG assignment uses nested double-quotes (TAG="v$(node -p "require('./package.json').version")"), which will be parsed incorrectly by bash and fail before the release logic runs. Use single-quotes around the Node expression or otherwise escape the inner quotes so the command substitution is valid.

Suggested change
TAG="v$(node -p "require('./package.json').version")"
TAG="v$(node -p 'require("./package.json").version')"

Copilot uses AI. Check for mistakes.
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