Repository navigation
feat: add npm-is-release action - #27
Merged
Merged
Conversation
rekmarks-consensys-1
force-pushed
the
ocap/npm-is-release
branch
from
November 23, 2026 23:03
248c58d to
e09d626
Compare
rekmarks-consensys-1
force-pushed
the
ocap/check-changelog
branch
from
November 23, 2026 23:03
515fd8b to
545ef4b
Compare
rekmarks-consensys-1
force-pushed
the
ocap/npm-is-release
branch
from
November 23, 2026 23:05
e09d626 to
d0ac68f
Compare
rekmarks-consensys-1
force-pushed
the
ocap/check-changelog
branch
2 times, most recently
from
November 23, 2026 23:26
bc6381b to
b31c471
Compare
rekmarks-consensys-1
force-pushed
the
ocap/npm-is-release
branch
2 times, most recently
from
November 24, 2026 19:36
09de74b to
d4d3b39
Compare
rekmarks-consensys-1
force-pushed
the
ocap/check-changelog
branch
2 times, most recently
from
November 24, 2026 19:54
1f7749e to
deea498
Compare
rekmarks-consensys-1
force-pushed
the
ocap/npm-is-release
branch
2 times, most recently
from
November 24, 2026 20:28
5144c62 to
5f381c2
Compare
rekmarks-consensys-1
force-pushed
the
ocap/check-changelog
branch
2 times, most recently
from
November 24, 2026 20:58
490ac84 to
92c4437
Compare
rekmarks-consensys-1
force-pushed
the
ocap/npm-is-release
branch
2 times, most recently
from
November 24, 2026 21:24
90d7df6 to
5a9860e
Compare
rekmarks-consensys-1
force-pushed
the
ocap/check-changelog
branch
2 times, most recently
from
November 24, 2026 21:39
0f5a1f7 to
d6a5bf0
Compare
rekmarks-consensys-1
force-pushed
the
ocap/npm-is-release
branch
2 times, most recently
from
November 24, 2026 22:37
59a3b46 to
5ee0017
Compare
rekmarks-consensys-1
force-pushed
the
ocap/check-changelog
branch
from
November 24, 2026 22:37
d6a5bf0 to
22ed9eb
Compare
rekmarks-consensys-1
force-pushed
the
ocap/npm-is-release
branch
2 times, most recently
from
November 25, 2026 00:16
c522e41 to
0103900
Compare
rekmarks-consensys-1
marked this pull request as ready for review
November 25, 2026 00:30
rekmarks-consensys-1
force-pushed
the
ocap/npm-is-release
branch
from
November 25, 2026 00:43
0103900 to
36f7d79
Compare
rekmarks-consensys-1
force-pushed
the
ocap/check-changelog
branch
from
November 25, 2026 00:54
923e190 to
55fa53f
Compare
rekmarks-consensys-1
changed the base branch from
ocap/check-changelog
to
ocap/check-changelog-bundle
November 25, 2026 01:05
rekmarks-consensys-1
force-pushed
the
ocap/check-changelog-bundle
branch
from
November 25, 2026 01:14
923e190 to
9b57241
Compare
rekmarks-consensys-1
force-pushed
the
ocap/npm-is-release
branch
from
November 25, 2026 01:14
36f7d79 to
766a69e
Compare
rekmarks-consensys-1
changed the base branch from
ocap/check-changelog-bundle
to
main
November 25, 2026 01:14
Verbatim copy of MetaMask/action-is-release, as the baseline for the port's changes: - action.yml -> npm-is-release/action.yml - scripts/is-release.sh -> npm-is-release/scripts/is-release.sh - README.md -> npm-is-release/README.md Upstream: https://github.com/MetaMask/action-is-release SHA: 3cd51b98fa98d1347d06f5961299b0172ee31ae8 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No change in behaviour: - action.yml: SPDX header, actions/checkout pinned to a commit SHA, named steps, shorter input descriptions, explicit empty default for commit-starts-with, and the action path passed through env rather than interpolated into `run`. - is-release.sh: SPDX header and usage comment, `set -u` with defaults for the optional variables, `::error::` annotation for a missing BEFORE, quiet fetch, lowercase locals, a set_output helper, and clearer log messages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Upstream tested `[[ $COMMIT_MESSAGE =~ ^$prefix ]]`, so each prefix was a regular expression: with version 1.2.0, `Release [version]` also matched `Release 1x2y0`, and characters such as `(` changed or broke the match. Compare with a quoted glob prefix instead. The `[version]` replacement is quoted too, so a `&` in the version is not expanded under bash 5.2's patsub_replacement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p empty ones commit-starts-with may now also be split across lines (a YAML block scalar), whitespace around each prefix is trimmed, and empty prefixes are skipped. Upstream kept the spaces in `a, b`, so the second prefix started with a space, and an empty prefix (e.g. from a trailing comma) matched every commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The checkout no longer leaves the token in the git config, so later steps in the caller's job cannot reuse it. Without credentials, fetching `before` fails in a private repository. For a single-commit push `before` is HEAD^, already present with fetch-depth 2, so the script now continues with a warning when the fetch fails but the commit is present, and fails only when it is missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test/fixtures.sh builds fixture repositories with local bare origins, clones them with --depth 2 (as actions/checkout with fetch-depth 2 does) and runs the script. It covers an unchanged version, each of ocap-kernel's release prefixes, a non-matching subject, the regex regression (`Release 1x2y0`), regex metacharacters in a prefix, spaced, newline-separated and empty prefixes, no prefixes, commit-message overriding the HEAD subject, a multi-commit push whose `before` must be fetched, and empty and all-zero `before`. The workflow runs the fixtures and runs the action itself with skip-checkout in a workspace prepared by `fixtures.sh --prepare-workspace`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Describe the port: provenance and differences from upstream, usage with a pinned SHA, inputs and outputs tables, behaviour (including the fetch fallback and the all-zero `before` limitation kept from upstream), and how the tests run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README said upstream's script fails only the two literal-matching fixtures; run against it, the fixtures also differ on spaced, newline-separated and empty prefixes (five cases in all). The script's usage comment still described COMMIT_STARTS_WITH as comma-separated only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The script is ported from MetaMask/action-is-release, which is MIT-licensed. NOTICE carries its copyright and permission notice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The checkout doesn't persist credentials, so in a private repository a push of more than one commit couldn't fetch before and the action failed. A new github-token input (default: the job token) is passed to that one git fetch as an Authorization header through GIT_CONFIG_* environment variables, so it is never in argv or .git/config. An empty value first clears any header the caller's checkout set for the same URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ting GIT_CONFIG_* entries Review findings on the token fetch: - Under RUNNER_DEBUG, set -x traced the token and its base64 before ::add-mask:: took effect. fetch_before now turns tracing off for its own body. - GIT_CONFIG_COUNT=2 replaced any command-scoped config already in the environment (e.g. a runner's http.proxy). The two entries are now appended after the existing ones, exported in a subshell so the credential is not in any argv. - The comment now says that a header configured for a more specific URL takes precedence. - Tests: the shim logs every config entry, so the reset entry is checked; new tests for existing entries and for the trace; the fixture runner clears GITHUB_TOKEN, GITHUB_SERVER_URL, RUNNER_DEBUG and GIT_CONFIG_COUNT from the developer's environment; the git path in the shim is quoted; the unfalsifiable .git/config check is dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
before is passed to git fetch and git show. A value starting with "-" was read as an option: --upload-pack=<command> ran the command against a local origin. Accept only 40 or 64 hexadecimal characters, and give the all-zero SHA of a new branch its own error instead of a failed fetch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The versions come from package.json and are printed and substituted into the prefixes. A version containing a newline followed by "::" was printed as a workflow command. Fail with a clear error if either version, at before or at HEAD, is missing or not semver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tree With skip-checkout the caller's checkout may have uncommitted changes, and an uncommitted version bump in package.json counted as a release of the pushed commit. Read package.json with git show HEAD:package.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a shallow clone The script fetched `before` on every run, and in a shallow clone a fetch without --depth downloads every ancestor of `before`, not just that commit. On a single-commit push, `before` is HEAD^ and already in the checkout (fetch-depth 2), so the fetch was not needed at all. Check for `before` first and fetch only when it is missing; the single-commit case then makes no network call and doesn't use the token. In a shallow clone, fetch with --depth=1. A full clone (possible with skip-checkout) is fetched into without --depth, so it isn't made shallow. The fallback warning for a failed fetch with `before` present is gone: a fetch now happens only when `before` is missing, so a failure is an error. The script reads only `before`'s package.json, so the shallow boundary at `before` doesn't matter. Suggested by Joshua Fernandes in review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add fixture tests for `before` already present (no fetch, token unused, an unreachable origin doesn't fail the run, no warning), missing from a shallow clone (only that commit fetched, clone stays shallow), missing from a full clone (clone not made shallow), and a failed fetch (error). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rekmarks-consensys-1
force-pushed
the
ocap/npm-is-release
branch
from
November 30, 2026 22:45
766a69e to
e407cdc
Compare
rekmarks-consensys-1
enabled auto-merge
November 30, 2026 22:57
joshuafernandes
approved these changes
Nov 30, 2026
joshuafernandes
left a comment
Contributor
There was a problem hiding this comment.
LGTM, awesome work @rekmarks-consensys-1
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.
Lines added, by type
Adds
npm-is-release, a port ofMetaMask/action-is-releasev2 (3cd51b9). On a push, it reportsIS_RELEASE=truewhen two things hold: the rootpackage.jsonversion changed sincebefore, and the commit message starts with one of thecommit-starts-withprefixes, if any are given.To review: the first commit is a verbatim copy of upstream's
action.yml,scripts/is-release.shandREADME.mdat3cd51b9, so reviewing commit by commit shows each change against upstream.Upstream's inputs and the
IS_RELEASEoutput are kept, and the one new input has a default, so callers only change theiruses:line. Upstream is MIT-licensed;NOTICEcarries its copyright and permission notice, and the README links to it.Differences from upstream
Release [version]with version1.2.0also matchedRelease 1x2y0, and characters like(broke the match.persist-credentials: false. A newgithub-tokeninput (default: the job token) is passed only to thegit fetchofbefore, as anAuthorizationheader throughGIT_CONFIG_*environment variables appended after any already set, so it is never in argv or.git/config, and it is left out of theRUNNER_DEBUGtrace. This lets a multi-commit push in a private repository fetchbefore.beforeis fetched only when it is missing, and without its ancestors in a shallow clone. On a single-commit push it isHEAD^, already in thefetch-depth: 2checkout, so there is no network call and the token isn't used. Otherwise it is fetched with--depth=1in a shallow clone; a full clone (fromskip-checkout) is fetched into without--depth, so it isn't made shallow. A failed fetch is an error. Upstream always fetchedbeforewith all its ancestors, which on a multi-commit push meant the repository's whole history. (Suggested by Joshua Fernandes in review.)beforemust be a full commit SHA (40 or 64 hexadecimal characters). Upstream passed any value togit fetchandgit show, where one starting with-is read as an option:--upload-pack=<command>ran the command against a local origin.::was printed as a workflow command.package.jsonatHEAD(git show HEAD:package.json). Upstream read the working tree, so withskip-checkoutan uncommitted version bump counted as a release.Known limitation, kept from upstream: a push that creates a branch has an all-zero
before, with no commit to compare with, so the action fails (now with its own error rather than a failed fetch). ocap-kernel only calls it on pushes tomain.Tests
test/fixtures.shbuilds fixture repositories with local origins and clones them with--depth 2, asactions/checkoutwithfetch-depth: 2would. It covers:commit-messageoverriding the HEAD subject;beforeis outside the clone and has to be fetched;beforeis fetched: already present (no fetch, token unused), missing from a shallow clone (only that commit fetched, clone stays shallow), missing from a full clone (not made shallow), and a failed fetch;Authorizationheader after a reset of the same key, that existingGIT_CONFIG_*entries are kept, and that the debug trace leaves out the token;before, an abbreviated SHA, a ref, an upper-case SHA, a 64-character SHA in a SHA-256 repository, and abeforethat is a git option, which must run no command;skip-checkout: true.+upstream read as a quantifier), the three prefix-list cases, the two checks of the token passed to the fetch, the check that abeforestarting with-runs no command, the four invalid version cases, the uncommitted-change case, and three of the new fetch checks.🤖 Generated with Claude Code