Skip to content

ci(ENG-4207): publish an existing release tag to npm on demand - #161

Merged
hiskudin merged 1 commit into
mainfrom
ci/eng-4207-publish-tag
Nov 18, 2026
Merged

hiskudin merged 1 commit into
mainfrom
ci/eng-4207-publish-tag

Conversation

@hiskudin

@hiskudin hiskudin commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

Adds a manual workflow_dispatch trigger to release-please.yml that publishes an existing release tag to npm.

Why: when the publish step fails after release-please has cut the release, re-running the job doesn't help. release-please sees the release already exists, reports nothing released, and skips every publish step. That's what happened to defender-v0.9.6.

How: run the workflow from the Actions tab with a tag, e.g. defender-v0.9.6. The new publish-tag job:

  1. checks the input is a release tag (defender-vX.Y.Z);
  2. checks out that tag with LFS (for the models);
  3. checks package.json's version matches the tag;
  4. builds and publishes with the same steps and NPM_TOKEN as the release job.

On a push to main, only the release-please job runs, as before.

🤖 Generated with Claude Code


Summary by cubic

Adds a manual workflow trigger to release-please.yml to publish an existing release tag to npm when the publish step fails after release-please has already cut the release.

  • Re-running the job doesn't help because release-please sees the release already exists and skips publishing.
  • The new publish-tag job checks the tag format, checks out the tag with LFS, verifies package.json matches the tag, then builds and publishes using the same steps and NPM_TOKEN as the release job.
  • On push to main, only the release-please job runs, keeping the existing behavior.

Written for commit 1716a39. Summary will update on new commits.

View guided diff Turn on auto-fix

When the publish step fails after release-please has cut the release, a
re-run skips publishing because the release already exists. A manual
run with a tag (e.g. defender-v0.9.6) now checks out that tag, checks
package.json matches it, builds and publishes, with the same steps and
token as the release job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hiskudin
hiskudin requested a review from a team as a code owner November 18, 2026 17:37
@hiskudin
hiskudin merged commit 2823471 into main Nov 18, 2026
5 of 6 checks passed
@hiskudin
hiskudin deleted the ci/eng-4207-publish-tag branch November 18, 2026 17:38
- name: Checkout Repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: refs/tags/${{ inputs.tag }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 High - Manual publish accepts attacker-created release tags

A repository user with write access can create an unprotected defender-vX.Y.Z tag on an arbitrary commit, set its package.json version to match, and dispatch this workflow. The job then runs that tag's package-defined build and publish scripts with NPM_TOKEN, allowing unauthorized publication of attacker-controlled package contents and potentially disclosure or misuse of the npm credential.

Show fix

Restrict this recovery path to release tags whose commits are authenticated and reachable from the protected release history, or require an approval-gated environment and an explicit allowlist of release actors. Do not rely only on the tag spelling and package version; independently verify tag provenance/immutability and consider replacing the long-lived npm token with a narrowly scoped, approval-protected publishing credential.

More info - Reply on this comment to give feedback or ignore the issue.

hiskudin added a commit that referenced this pull request Nov 18, 2026
It published defender-v0.9.6 after the release job's npm token failed.
Publishing is back on the release job, so the manual path isn't needed.
This reverts #161.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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