workflows: replace softprops/action-gh-release with gh CLI (main)#20
Open
harshita-gupta wants to merge 2 commits intomainfrom
Open
workflows: replace softprops/action-gh-release with gh CLI (main)#20harshita-gupta wants to merge 2 commits intomainfrom
harshita-gupta wants to merge 2 commits intomainfrom
Conversation
Supply-chain hardening: softprops/action-gh-release is a single-maintainer third-party action pinned to the mutable @v1 tag. Replacing it with the first-party `gh` CLI (pre-installed on GitHub-hosted runners, maintained by GitHub) removes that dependency from the release-upload path. Follow-up to #18, which migrated build-node-packages.yml. This migrates the remaining three workflows that still used the action: - build-node.yml - build-node-fibers.yml - build-node-openssl-fips.yml Each Upload step becomes: - view-or-create guard so the first matrix arm creates the release (and the second arm tolerates the race); - `gh release upload --clobber` for the asset (matches softprops's always-delete-then-upload behavior on name collision); - `gh release edit --title` to preserve softprops's behavior of always re-setting the release name on every upload. Each job also picks up `REPO: ${{ github.repository }}` in its env block for consistency with the pattern established in #18.
The previous comment blocks were framed as migration notes ("instead of
softprops..."). Rewrite them as forward-looking descriptions of what each
step does and the decisions/pitfalls that matter to a future maintainer:
matrix-race behavior, --clobber tradeoff, deterministic-title reasoning.
This was referenced Apr 23, 2026
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.
Summary
Supply-chain hardening:
softprops/action-gh-releaseis a single-maintainer third-party action pinned to the mutable@v1tag. If that account is compromised or the tag is re-pointed, every workflow depending on it runs whatever the new code does. Replacing it with the first-partyghCLI (pre-installed on GitHub-hosted runners, maintained by GitHub) removes that dependency from the release-upload path.This is a follow-up to #18, which migrated
build-node-packages.yml. It migrates the remaining three workflows that still usedsoftprops/action-gh-release@v1onmain:.github/workflows/build-node.yml.github/workflows/build-node-fibers.yml.github/workflows/build-node-openssl-fips.ymlAfter this PR: zero references to third-party release-upload actions on
main.This is the canary PR. If it merges and workflow validation succeeds, I'll open equivalent PRs against
v22.21.1,v22.21.1-profiler,v24.13.0, andv20.18.3(which still use softprops).Replacement shape
Each softprops step becomes (shell-quoted,
set -euo pipefail):Each job also picks up
REPO: ${{ github.repository }}in its job-levelenv:, matching the pattern from #18.Behavior deltas vs. softprops/action-gh-release@v1
Based on reading the source of both tools — softprops at the
v1tag SHA (de2c0eb8,src/main.ts+src/github.ts) andghCLI at the installed v2.90.0 (pkg/cmd/release/{upload,create}/*.go).gh release uploadrequires release to existview || createpreamblegh release createhas no retrycreate || viewidiom: the loser of the race falls through viaviewgh release uploaddefault errors,--clobbermatches softprops--clobbernameon upload (viaupdateRelease);gh release uploaddoesn't touch namegh release edit --titleafter uploadupdateReleasealso resets body/draft/prerelease to existing values;gh release editwithout those flags is a no-op for themfiles:;gh release uploadalso glob-expands viaGlobPathsgh release uploadfails on missing literal path viaos.Statgh release uploadretries 3× on 5xx or network errorurl,id,upload_url,assetsare not set byrun:blocksGITHUB_TOKEN;ghaccepts eitherGH_TOKENorGITHUB_TOKENGITHUB_TOKENfor consistency with #18Test plan
Build Nodeviaworkflow_dispatchonmain. Verify the asset appears in thenode-${NODE_VERSION}-releaserelease and that the release title isnode-${NODE_VERSION}-LATEST.Build Node-Packages(already onghCLI from workflows: swap softprops for gh CLI, add CloudFront reachability check, remove --acl #18) succeeds end-to-end.Build node-fibers with prebuilt Nodeviaworkflow_dispatch. Verify the fibers archive appears in the same release.Build Node with options around OpenSSL dynamic linking and FIPSviaworkflow_dispatch(needs aBUILD_REFinput). Verify the asset appears innode-${NODE_VERSION}-fips-static-releasewith titlenode-${NODE_VERSION}-fips-static-LATEST.sha256summatches.linux-x64andlinux-arm64in parallel — confirm no step fails when both try to create the release at the same time.Out of scope
v22.21.1,v22.21.1-profiler,v24.13.0,v20.18.3branches still use softprops. Equivalent PRs will follow once this canary validates.build-node-packages.ymlis not touched here — workflows: swap softprops for gh CLI, add CloudFront reachability check, remove --acl #18 already migrated it (with a simpler pattern that omits thegh release edit --titlepostamble, because it's not the first uploader and the title is set by this PR'sbuild-node.ymlstep running earlier in the pipeline).