Skip to content

Replace archived and unpinned actions in the release workflows - #779

Open
khmMouna wants to merge 2 commits into
mainfrom
MOBILE-5967-replace-archived-and-unpinned-actions-in-the-release-workflows
Open

khmMouna wants to merge 2 commits into
mainfrom
MOBILE-5967-replace-archived-and-unpinned-actions-in-the-release-workflows

Conversation

@khmMouna

@khmMouna khmMouna commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor
  • Pinned actions to full commit SHAs (with a version comment) in ci.yml, publish-docs.yml, release.yml and prep-release.yml. The one exception is ruby/setup-ruby, which stays on @v1 because upstream recommends against pinning it (a pinned commit only carries the Ruby builds that existed at that commit).
  • Bumped outdated actions while pinning: actions/setup-java v3 → v6.1.0 and peter-evans/create-pull-request v5 → v8.1.1 (both were still on node16).
  • .github/dependabot.yml (new): weekly github-actions updates, grouped into a single PR, so the SHA pins keep getting reviewable updates.
  • release.yml
    • Removed ::set-output; the version comes from github.ref_name.
    • Replaced actions/create-release with gh release create --notes-file --verify-tag; the github-release job now has permissions: contents: write.
    • Release notes are extracted by the new scripts/release_notes.sh, which matches the ## Version X heading exactly (so 27.0.1 can't match 27.0.10) and fails if the section is missing or empty. It runs in check-version, so a tag without a changelog entry stops the run before module publishes to npm.
    • Replaced slatify with slackapi/slack-github-action v4.0.0 (SHA-pinned), keeping the same success/failure/cancelled logic and adding status colours.
  • prep-release.yml
    • Replaced both slatify steps with slackapi/slack-github-action v4.0.0.
    • Both notifications now ping the mobile-team Slack group through the new SLACK_MOBILE_TEAM_ID repository variable (previously plain @mobile-team / @crow text that notified no one).

@khmMouna
khmMouna requested a review from a team as a code owner October 20, 2026 15:13
@khmMouna khmMouna self-assigned this Oct 20, 2026
Comment thread .github/workflows/ci.yml
runs-on: macos-26-xlarge
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing updates these pins once they're in — @v4 used to pick up patches on its own. A github-actions entry in .github/dependabot.yml would turn that back into reviewable PRs.

Comment thread .github/workflows/ci.yml Outdated
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@e9fbacdec3bb3b6036605a3e6f7995d66773a8c6 # v3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This SHA is the commit that deprecates setup-java v3, and v3 still declares runs.using: node16. Pinning it freezes CI on a major upstream has stopped maintaining; v6 is current.

Comment thread .github/workflows/ci.yml Outdated

- name: Set up Ruby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@651ff0d62c5c79bed6d53ec518387aae20e72c1a # v1.329.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ruby/setup-ruby is the one action here upstream asks you not to pin — a pinned commit only carries the Ruby builds that existed at that commit, so a new macos-26-xlarge image can leave 3.0.1 unavailable and fail every PR. It's already behind v1.332.0.

Comment thread .github/workflows/prep-release.yml Outdated
- name: Create Pull Request
id: create-pr
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@4e1beaa7521e8b457b572c090b25bd3db56bf1c5 # v5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v5.0.3 is from March 2024 and still declares runs.using: node16; v8 is current. This workflow is workflow_dispatch-only, so when the node16 shim goes away nothing fails until someone starts a release.

Comment thread .github/workflows/prep-release.yml Outdated
payload: |
attachments:
- color: good
text: ":tada: React Native plugin release pull request generated :tada:\n<!subteam^${{ secrets.SLACK_MOBILE_TEAM_ID }}> A new React Native plugin release pull request for (v${{ github.event.inputs.react_native_version }}) is ready! :rocket:\n${{ steps.create-pr.outputs.pull-request-url }}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If SLACK_MOBILE_TEAM_ID is ever unset this expands to <!subteam^>, which Slack renders as inert text and pages no one — the same silent failure as the old @mobile-team. Masking also keeps the value out of the run log, so a repo variable would be easier to confirm is right. Same on the failure notification below.

Comment thread .github/workflows/release.yml Outdated
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.ref_name }}
run: |
awk -v v="## Version $VERSION" '$0 ~ v {flag=1; next} /## Version/ {flag=0} flag' CHANGELOG.md > release_notes.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$0 ~ v is unanchored, so releasing 27.0.1 after 27.0.10 exists would match the 27.0.10 heading first and ship its notes. Pre-existing in the old awk, but this line is being rewritten anyway.

VERSION: ${{ github.ref_name }}
run: |
awk -v v="## Version $VERSION" '$0 ~ v {flag=1; next} /## Version/ {flag=0} flag' CHANGELOG.md > release_notes.md
gh release create "$VERSION" --title "$VERSION" --notes-file release_notes.md --verify-tag

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing checks release_notes.md is non-empty, and check_version.sh only compares the tag to package.json — it never looks at CHANGELOG.md. A tag the trigger allows but the changelog has no heading for (27.1.0-beta.1) publishes a release with an empty body, after module may already have pushed to npm.

@Ulrico972 Ulrico972 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup — verified all the pinned SHAs resolve to the tags they claim, and the release_notes.sh version-prefix fix looks solid.

One small note: check-version runs release_notes.sh once to validate the changelog section exists, then github-release runs it again to actually produce the notes. Intentional (fail fast before module publishes), just might be worth a one-line comment so it doesn't look like duplicated work later.

This branch has not been deployed

No deployments
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.

4 participants