Skip to content

fix(ci): add E403 guard to CLI publish step — idempotent on re-runs#1330

Merged
jpleva91 merged 1 commit intomainfrom
fix/publish-cli-e403-guard
Mar 29, 2026
Merged

fix(ci): add E403 guard to CLI publish step — idempotent on re-runs#1330
jpleva91 merged 1 commit intomainfrom
fix/publish-cli-e403-guard

Conversation

@jpleva91
Copy link
Copy Markdown
Collaborator

Summary

  • The Publish @red-codes/agentguard (CLI) step was the only publish step without E403/"already published" handling
  • When the workflow runs multiple times for the same release, subsequent runs fail with npm error 403 instead of gracefully skipping
  • Applies the same idempotent pattern already used by all 6 library package steps

Root cause

publish.yml line 144 (before this fix) ran a bare pnpm publish with no error guard. All other publish steps already wrap the command to treat E403: already published as a warning, not a failure.

Evidence

v2.10.2 release (2026-03-29) triggered 4 workflow runs. Run 3 succeeded; run 4 failed with E403: cannot publish over previously published versions: 2.10.2. Tracked in #1329.

Test plan

  • Verify workflow lint passes (no YAML errors)
  • Confirm the pattern matches the existing aguard wrapper step exactly
  • On next release, confirm re-runs succeed (or emit ::notice:: and skip)

Closes #1329

🤖 Generated with Claude Code

Closes #1329

The `Publish @red-codes/agentguard (CLI)` step was the only publish
step in the workflow without "already published" handling. When the
release workflow is triggered multiple times (e.g. draft→publish
or manual re-run), subsequent runs fail with E403 rather than
gracefully skipping. All library package steps already use this
pattern; apply it to the CLI step for consistency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jpleva91 jpleva91 merged commit 6f7d997 into main Mar 29, 2026
4 checks passed
@jpleva91
Copy link
Copy Markdown
Collaborator Author

Auto-merged by PR Merger Agent. All quality gates passed.

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.

bug(release): publish.yml missing E403 guard on CLI publish step causes spurious failures on re-runs

1 participant