Skip to content

Allow manual npm publish workflow runs - #10

Merged
sf-jin-ku merged 1 commit into
mainfrom
jin/publish-workflow-dispatch
Apr 5, 2026
Merged

sf-jin-ku merged 1 commit into
mainfrom
jin/publish-workflow-dispatch

Conversation

@sf-jin-ku

Copy link
Copy Markdown
Contributor

Summary

  • add workflow_dispatch to the npm publish workflow
  • allow a ref input so publish can be retried from the chosen git ref without recreating the release

Testing

  • ruby -e 'require "yaml"; YAML.load_file(".github/workflows/publish.yml"); puts "ok"'
  • git diff --check -- .github/workflows/publish.yml

@sf-jin-ku
sf-jin-ku merged commit 3605760 into main Apr 5, 2026
3 checks passed
@sf-jin-ku
sf-jin-ku deleted the jin/publish-workflow-dispatch branch April 5, 2026 17:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8ca528460

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- uses: actions/checkout@v6
with:
ref: ${{ github.event.release.tag_name }}
ref: ${{ github.event.release.tag_name || inputs.ref || github.ref_name }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Honor selected workflow ref before defaulting to main

For workflow_dispatch runs, inputs.ref has a default (main), so this expression resolves to main whenever the input is left as-is, even if the run was started from a tag/branch in the Actions UI. In a publish workflow, that can cause a manual retry intended for a release tag to publish code from main instead. Reorder/fence this fallback so the selected run ref is used unless an explicit override was provided.

Useful? React with 👍 / 👎.

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.

1 participant