Skip to content

Fix: release workflow uses inputs.tag_name for workflow_dispatch#1378

Merged
hortison merged 1 commit intomasterfrom
fix/release-workflow-dispatch
Mar 24, 2026
Merged

Fix: release workflow uses inputs.tag_name for workflow_dispatch#1378
hortison merged 1 commit intomasterfrom
fix/release-workflow-dispatch

Conversation

@hortison
Copy link
Copy Markdown
Contributor

Summary

  • The release workflow was using github.event.release.tag_name in the Set Package Version step, which is only populated for release events
  • When triggered via workflow_dispatch, this evaluates to an empty string, causing the version to not be updated and the publish to fail with "cannot publish over previously published version"
  • Fix: use ${{ github.event.release.tag_name || inputs.tag_name }} to fall back to the workflow dispatch input

Test plan

  • Trigger workflow via workflow_dispatch with a valid version tag (e.g. v0.18.1) and verify the publish succeeds

The release workflow was using github.event.release.tag_name which is only
set for release events, not workflow_dispatch. Add fallback to inputs.tag_name
so manual workflow_dispatch triggers correctly set the package version.

Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
Copilot AI review requested due to automatic review settings March 24, 2026 05:07
@hortison hortison merged commit 96a1a6b into master Mar 24, 2026
4 of 5 checks passed
@github-actions github-actions bot added the area/ci Continuous integration | Build and release label Mar 24, 2026
@hortison hortison deleted the fix/release-workflow-dispatch branch March 24, 2026 05:07
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

This PR fixes the release workflow so that the package version is correctly derived when the workflow is triggered via workflow_dispatch, avoiding publishes that fail due to an unchanged/previously-published version.

Changes:

  • Update the Set Package Version step to use github.event.release.tag_name with a fallback to inputs.tag_name for workflow_dispatch.

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

Comment on lines 41 to 45
uses: reedyuk/npm-version@1.1.1
with:
version: ${{ github.event.release.tag_name }}
version: ${{ github.event.release.tag_name || inputs.tag_name }}

- name: Install, Build, and Publish Package
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

This change fixes the version source for the publish step on workflow_dispatch, but the workflow still uses github.event.release.tag_name elsewhere (e.g., the notify-dependents job computes release_version from it). When triggered via workflow_dispatch, that value will still be empty, so downstream notification/version outputs will be wrong. Consider applying the same fallback (or centralizing the resolved tag into a single env/output) so all steps/jobs use the same tag source.

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

area/ci Continuous integration | Build and release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants