workflows: replace softprops/action-gh-release with gh CLI (v22.21.1)#21
Draft
harshita-gupta wants to merge 1 commit intov22.21.1from
Draft
workflows: replace softprops/action-gh-release with gh CLI (v22.21.1)#21harshita-gupta wants to merge 1 commit intov22.21.1from
harshita-gupta wants to merge 1 commit intov22.21.1from
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. Migrates all four release-upload call-sites on v22.21.1: - build-node.yml - build-node-fibers.yml - build-node-openssl-fips.yml - build-node-packages.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.
13 tasks
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.
DO NOT MERGE until canary PR #20 (main) is validated
This is part of the rollout of the softprops β gh-CLI migration across all Asana/node branches. The canary PR on main (#20) must be merged and end-to-end validated first. Merging this PR before then risks landing a regression on a production release branch with no safety net.
Validation checklist to complete on main (#20) before touching this PR
Copy these into PR #20 when you work it:
main.mainviaworkflow_dispatch. Both matrix arms (linux-x64,linux-arm64) succeed without a race failure ongh release create.node-vX.Y.Z-releaseexists (or continues to exist) with titlenode-vX.Y.Z-LATEST, and both architecture archives appear as assets.main. Assets appear; release title still correct.main. Assets appear; release title still correct.mainwith appropriateBUILD_REF. Assets appear in the separate-fips-static-releaserelease with the expected title.sha256sumof an asset uploaded post-migration against one uploaded pre-migration on another branch β should match.Only after all of those pass β mark this PR ready for review and merge.
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.Migrates all four release-upload call-sites on
v22.21.1:.github/workflows/build-node.yml.github/workflows/build-node-fibers.yml.github/workflows/build-node-openssl-fips.yml.github/workflows/build-node-packages.ymlAfter this PR: zero references to
softprops/action-gh-releaseonv22.21.1.Replacement shape
Each softprops step becomes:
Each job gains
REPO: ${{ github.repository }}in its job-levelenv:. Thebuild-node-openssl-fips.ymljob had no job-level env block previously; it gets a minimal one containing onlyREPO.Divergence from main's post-migration shape
On
main,build-node-packages.ymluses a simpler upload pattern (plaingh release upload --clobber, no view-or-create guard, nogh release edit --title), because it runs downstream ofbuild-node.yml. On this branch the workflow is migrated with the full pattern (view-or-create + edit --title) to preserve the behavior softprops gave us: the release and title are re-asserted on every upload, including for standaloneworkflow_dispatchruns of packages. If you'd rather match main's simpler shape here, say so and I'll simplify.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 v2.90.0 (pkg/cmd/release/{upload,create}/*.go).gh release uploadrequires release to existview || createpreamblegh release createhas no retrycreate || viewidiom: losing racer falls through viaviewgh release uploaddefault errors,--clobbermatches softprops--clobbernameon upload (viaupdateRelease);gh release uploaddoesn't touch namegh release edit --titleafter uploadupdateReleaseresets 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_TOKENPost-merge test plan for this branch
v22.21.1viaworkflow_dispatch. Assets appear innode-v22.21.1-release.workflow_run) or is dispatched. Assets appear.BUILD_REF=v22.21.1. Assets appear innode-v22.21.1-fips-release.sha256summatches pre-migration.