2727env :
2828 NX_CLOUD_ENCRYPTION_KEY : ${{ secrets.NX_CLOUD_ENCRYPTION_KEY }}
2929 NX_CLOUD_ACCESS_TOKEN : ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
30+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
31+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
32+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
33+ SLACK_WEBHOOK_URL_BETA : ${{ secrets.SLACK_WEBHOOK_URL_BETA }}
3034 HUSKY : 0
3135 CI : true
3236
@@ -42,13 +46,19 @@ jobs:
4246 id-token : write # OIDC for provenance if npm publish happens here
4347 runs-on : ubuntu-latest
4448 steps :
49+ - name : Branch name
50+ run : |
51+ echo "Checking out branch: ${{ github.ref_name }}"
52+
4553 - name : Checkout repository
4654 uses : actions/checkout@v4
4755 with :
4856 fetch-depth : 0
4957
5058 - name : Setup publish
5159 uses : ./.github/actions/setup-publish
60+ with :
61+ CODECOV_TOKEN : ${{ env.CODECOV_TOKEN }}
5262
5363 # This action creates a release pull request with all of
5464 # the package versions and changelogs updated. When there
6777 setupGitUser : true
6878 env :
6979 HOME : ${{ github.workspace }} # See https://github.com/changesets/action/issues/147
70- GITHUB_TOKEN : ${{ secrets .GITHUB_TOKEN }}
80+ GITHUB_TOKEN : ${{ env .GITHUB_TOKEN }}
7181 NPM_CONFIG_PROVENANCE : ' true'
72- NPM_TOKEN : ${{ secrets.NPM_ACCESS_TOKEN }}
7382
7483 - name : Publish previews to Stackblitz on PR
7584 if : steps.changesets.outputs.published == 'false'
@@ -88,23 +97,23 @@ jobs:
8897 git rebase master
8998 git push -f
9099 env :
91- GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
100+ GITHUB_TOKEN : ${{ env.GITHUB_TOKEN }}
92101
93102 - name : Send GitHub Action data to a Slack workflow
94103 if : steps.changesets.outputs.published == 'true'
95104 uses : slackapi/slack-github-action@v2.1.1
96105 with :
97106 payload-delimiter : ' _'
98- webhook : ${{ secrets .SLACK_WEBHOOK_URL }}
107+ webhook : ${{ env .SLACK_WEBHOOK_URL }}
99108 webhook-type : webhook-trigger
100109 payload : |
101- text: ${{ steps.changesets.outputs.publishedPackages }}
110+ publishedPackages: steps.changesets.outputs.publishedPackages
102111
103112 - name : Run code coverage
104113 uses : codecov/codecov-action@v5
105114 with :
106115 files : ./packages/**/coverage/*.xml
107- token : ${{ secrets .CODECOV_TOKEN }}
116+ token : ${{ env .CODECOV_TOKEN }}
108117
109118 snapshot :
110119 # On manual trigger of GH action, publish a snapshot release to npm
@@ -115,6 +124,10 @@ jobs:
115124 id-token : write # OIDC for provenance when npm publish happens
116125 runs-on : ubuntu-latest
117126 steps :
127+ - name : Branch name
128+ run : |
129+ echo "Checking out branch: ${{ github.ref_name }}"
130+
118131 # Checkout the branch selected when triggering the workflow
119132 - name : Checkout repository
120133 uses : actions/checkout@v4
@@ -123,21 +136,25 @@ jobs:
123136
124137 - name : Setup publish
125138 uses : ./.github/actions/setup-publish
139+ with :
140+ CODECOV_TOKEN : ${{ env.CODECOV_TOKEN }}
126141
127142 - name : Version packages for snapshot
128143 run : pnpm changeset version --snapshot ${{ inputs.snapshot_tag }}
129144 env :
130- GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
145+ GITHUB_TOKEN : ${{ env.GITHUB_TOKEN }}
131146
132147 - name : Publish packages snapshot with npm_tag
148+ id : npmpublish
133149 run : pnpm publish -r --tag ${{ inputs.npm_tag }} --no-git-checks --access ${{ inputs.npm_access }}
134150
135151 - name : Send GitHub Action data to a Slack workflow
136- if : steps.changesets.outputs.published == 'true '
152+ if : steps.npmpublish.outcome == 'success '
137153 uses : slackapi/slack-github-action@v2.1.1
138154 with :
139155 payload-delimiter : ' _'
140- webhook : ${{ secrets.SLACK_WEBHOOK_URL }}
156+ webhook : ${{ env.SLACK_WEBHOOK_URL_BETA }}
141157 webhook-type : webhook-trigger
142158 payload : |
143- text: ${{ steps.changesets.outputs.publishedPackages }}
159+ npmTag: "${{ inputs.npm_tag }}"
160+ publishedPackages: ""
0 commit comments