[XELP] Fail early on a tag collision in the npm release - #5
Merged
Conversation
The publish runs before the tag is pushed, and a published version cannot be replaced, so a tag that already exists would be discovered only after the package had shipped, leaving a release that no re-run can tag. The shadow release used this same version scheme, so its tags are real candidates. Check for the tag in the same preflight that checks the published version. Reading a dependency from another repository's package is granted through that package's Manage Actions access, which makes GITHUB_TOKEN sufficient. No organization secret reaches these forks, so the GH_TOKEN fallback could never have resolved to anything, and its presence only suggested otherwise. Also state explicitly that CI needs packages: read, rather than depending on a repository default that an organization can tighten, and stop describing the dry run as packing when it only reports what would be packed.
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions release workflow for the XELP npm package to fail early when a release would be impossible to tag, and tightens CI permissions/documentation around GitHub Packages access.
Changes:
- Add a preflight check that aborts the release if the computed git tag already exists (before publishing).
- Remove the
GH_TOKENfallback from the release workflow’s dependency install step and clarify package-access requirements in comments. - Make
packages: readexplicit in CI, and rename the dry-run “pack” step to reflectnpm pack --dry-runbehavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/xelp_npm_release.yml | Adds remote tag collision preflight and simplifies release workflow auth/token usage and messaging. |
| .github/workflows/build.yml | Adds explicit job permissions for GitHub Packages reads during npm ci. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow ups from the review on #4, now that the package access is granted and working.
The publish runs before the tag is pushed, and a published version cannot be replaced, so
a tag that already exists would only be discovered after the package had shipped, leaving
a release that no re-run can tag. The shadow release used the same version scheme, so its
tags are real candidates for that collision. The preflight now checks for the tag as well
as the published version.
Drops the
GH_TOKENfallback from the install step. Reading another repository's packageis granted through that package's Manage Actions access, which makes
GITHUB_TOKENsufficient, and no organization secret reaches this fork, so the fallback could never have
resolved to anything.
Also makes
packages: readexplicit in CI rather than relying on a repository default, andstops describing the dry run as packing when it only reports what would be packed.