From 77a2d2e8be87711418d96963eb983576d83745ed Mon Sep 17 00:00:00 2001 From: ignaciosantise <25931366+ignaciosantise@users.noreply.github.com> Date: Thu, 12 Feb 2026 15:03:41 -0300 Subject: [PATCH 1/2] fix: use correct PR for prerelease comments and add Slack notifications - Fix prerelease comment targeting wrong PR by using changesets action's pullRequestNumber output instead of broken commit API lookup - Add Slack notifications after snapshot and canary releases with version, tag, branch, actor, npm link, and install command - Applies to both snapshot.yml (workflow dispatch) and changesets.yml (main branch canary releases) Co-Authored-By: Claude Haiku 4.5 --- .github/workflows/changesets.yml | 51 +++++++++++++++++++++++++------- .github/workflows/snapshot.yml | 43 +++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 11 deletions(-) diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml index 5315833f..2630b365 100644 --- a/.github/workflows/changesets.yml +++ b/.github/workflows/changesets.yml @@ -81,17 +81,46 @@ jobs: echo "VERSION=$VERSION" >> $GITHUB_ENV - name: Comment Version on Pull Request - if: steps.changesets.outputs.published != 'true' + if: steps.changesets.outputs.published != 'true' && steps.changesets.outputs.pullRequestNumber env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # Find PR associated with the current commit - PR_NUMBER=$(gh api repos/${{ github.repository }}/commits/${{ github.sha }}/pulls \ - --jq '.[0].number' 2>/dev/null || echo "") - - if [ -n "$PR_NUMBER" ] && [ "$PR_NUMBER" != "null" ]; then - gh pr comment $PR_NUMBER --body "Published pre-release version: ${{ env.VERSION }}" - echo "Commented on PR #$PR_NUMBER" - else - echo "No associated PR found. This might be a direct push to main." - fi + gh pr comment ${{ steps.changesets.outputs.pullRequestNumber }} \ + --body "Published pre-release version: ${{ env.VERSION }}" + echo "Commented on PR #${{ steps.changesets.outputs.pullRequestNumber }}" + + - name: Send Slack notification + if: steps.changesets.outputs.published != 'true' + uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + { + "text": "📦 AppKit RN Canary Published", + "blocks": [ + { + "type": "header", + "text": { "type": "plain_text", "text": "📦 AppKit RN Canary Published" } + }, + { + "type": "section", + "fields": [ + { "type": "mrkdwn", "text": "*Version:*\n`${{ env.VERSION }}`" }, + { "type": "mrkdwn", "text": "*Tag:*\n`canary`" }, + { "type": "mrkdwn", "text": "*Branch:*\n`${{ github.ref_name }}`" }, + { "type": "mrkdwn", "text": "*Triggered by:*\n`${{ github.actor }}`" } + ] + }, + { + "type": "section", + "text": { "type": "mrkdwn", "text": "*NPM:* " } + }, + { + "type": "context", + "elements": [ + { "type": "mrkdwn", "text": "Install: `yarn add @reown/appkit-react-native@canary`" } + ] + } + ] + } diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 1c2c8632..51a585a4 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -92,6 +92,49 @@ jobs: yarn run changeset:prepublish:ci yarn run changeset publish --no-git-tag --snapshot $snapshot --tag $snapshot + - name: Get NPM Version + if: steps.check-changesets.outputs.has_changesets == 'true' + id: get_version + run: | + VERSION=$(node -pe "require('./package.json').version") + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + + - name: Send Slack notification + if: steps.check-changesets.outputs.has_changesets == 'true' + uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + { + "text": "📦 AppKit RN Snapshot Published", + "blocks": [ + { + "type": "header", + "text": { "type": "plain_text", "text": "📦 AppKit RN Snapshot Published" } + }, + { + "type": "section", + "fields": [ + { "type": "mrkdwn", "text": "*Version:*\n`${{ steps.get_version.outputs.VERSION }}`" }, + { "type": "mrkdwn", "text": "*Tag:*\n`${{ steps.determine-tag.outputs.tag }}`" }, + { "type": "mrkdwn", "text": "*Branch:*\n`${{ github.ref_name }}`" }, + { "type": "mrkdwn", "text": "*Triggered by:*\n`${{ github.actor }}`" } + ] + }, + { + "type": "section", + "text": { "type": "mrkdwn", "text": "*NPM:* " } + }, + { + "type": "context", + "elements": [ + { "type": "mrkdwn", "text": "Install: `yarn add @reown/appkit-react-native@${{ steps.determine-tag.outputs.tag }}`" } + ] + } + ] + } + - name: Get Snapshot Tag id: get-snapshot-tag run: | From 92fdf6ef3af475441f06c732be8751ef0dc06993 Mon Sep 17 00:00:00 2001 From: ignaciosantise <25931366+ignaciosantise@users.noreply.github.com> Date: Thu, 12 Feb 2026 15:27:16 -0300 Subject: [PATCH 2/2] fix: gate notifications on publish success and add continue-on-error - Add id to publish step and gate PR comment, version, and Slack steps on publish_prerelease.outcome == 'success' - Switch from GITHUB_ENV to GITHUB_OUTPUT for version consistency - Add continue-on-error to Slack steps so failures don't block releases Co-Authored-By: Claude Opus 4.6 --- .github/workflows/changesets.yml | 16 +++++++++------- .github/workflows/snapshot.yml | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml index 2630b365..49ea8b91 100644 --- a/.github/workflows/changesets.yml +++ b/.github/workflows/changesets.yml @@ -61,6 +61,7 @@ jobs: # gh release create "v$VERSION" --generate-notes --target main - name: Publish NPM pre-release + id: publish_prerelease if: steps.changesets.outputs.published != 'true' continue-on-error: true env: @@ -74,23 +75,24 @@ jobs: yarn run changeset publish --no-git-tag --snapshot canary --tag canary - name: Get NPM Version - if: steps.changesets.outputs.published != 'true' + if: steps.publish_prerelease.outcome == 'success' id: get_version run: | VERSION=$(node -pe "require('./package.json').version") - echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - name: Comment Version on Pull Request - if: steps.changesets.outputs.published != 'true' && steps.changesets.outputs.pullRequestNumber + if: steps.publish_prerelease.outcome == 'success' && steps.changesets.outputs.pullRequestNumber env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh pr comment ${{ steps.changesets.outputs.pullRequestNumber }} \ - --body "Published pre-release version: ${{ env.VERSION }}" + --body "Published pre-release version: ${{ steps.get_version.outputs.VERSION }}" echo "Commented on PR #${{ steps.changesets.outputs.pullRequestNumber }}" - name: Send Slack notification - if: steps.changesets.outputs.published != 'true' + if: steps.publish_prerelease.outcome == 'success' + continue-on-error: true uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a with: webhook: ${{ secrets.SLACK_WEBHOOK_URL }} @@ -106,7 +108,7 @@ jobs: { "type": "section", "fields": [ - { "type": "mrkdwn", "text": "*Version:*\n`${{ env.VERSION }}`" }, + { "type": "mrkdwn", "text": "*Version:*\n`${{ steps.get_version.outputs.VERSION }}`" }, { "type": "mrkdwn", "text": "*Tag:*\n`canary`" }, { "type": "mrkdwn", "text": "*Branch:*\n`${{ github.ref_name }}`" }, { "type": "mrkdwn", "text": "*Triggered by:*\n`${{ github.actor }}`" } @@ -114,7 +116,7 @@ jobs: }, { "type": "section", - "text": { "type": "mrkdwn", "text": "*NPM:* " } + "text": { "type": "mrkdwn", "text": "*NPM:* " } }, { "type": "context", diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 51a585a4..e657fdd8 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -101,6 +101,7 @@ jobs: - name: Send Slack notification if: steps.check-changesets.outputs.has_changesets == 'true' + continue-on-error: true uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a with: webhook: ${{ secrets.SLACK_WEBHOOK_URL }}