1313 SERVER_PRESET : ' node-server'
1414
1515permissions :
16- contents : write
17- id-token : write
18- pull-requests : write
16+ contents : read
1917
2018jobs :
2119 release :
2220 name : Release
2321 if : " !contains(github.event.head_commit.message, 'ci: changeset release')"
2422 runs-on : ubuntu-latest
23+ permissions :
24+ contents : write
25+ id-token : write
26+ pull-requests : write
2527 steps :
2628 - name : Checkout
27- uses : actions/checkout@v6.0.2
29+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2830 with :
2931 fetch-depth : 0
32+ persist-credentials : true # release job pushes version changes
3033 - name : Check for changesets
3134 id : changesets
3235 run : |
6164 git config user.email "github-actions[bot]@users.noreply.github.com"
6265 git add .
6366 if git commit -m "ci: changeset release"; then
64- git push
67+ git push origin "HEAD:${GITHUB_REF_NAME}"
6568 echo "committed=true" >> "$GITHUB_OUTPUT"
6669 fi
6770 env :
@@ -80,10 +83,14 @@ jobs:
8083 fi
8184 - name : Publish Packages
8285 if : steps.commit.outputs.committed == 'true'
83- run : pnpm run changeset:publish ${{ steps.dist-tag.outputs.tag && format('--tag {0}', steps.dist-tag.outputs.tag) }}
86+ run : pnpm run changeset:publish ${DIST_TAG_ARG}
87+ env :
88+ DIST_TAG_ARG : ${{ steps.dist-tag.outputs.tag && format('--tag {0}', steps.dist-tag.outputs.tag) }}
8489 - name : Create GitHub Release
8590 if : steps.commit.outputs.committed == 'true'
86- run : node scripts/create-github-release.mjs ${{ steps.dist-tag.outputs.prerelease == 'true' && '--prerelease' }} ${{ steps.dist-tag.outputs.latest == 'true' && '--latest' } }
91+ run : node scripts/create-github-release.mjs ${PRERELEASE_ARG} ${LATEST_ARG }
8792 env :
93+ PRERELEASE_ARG : ${{ steps.dist-tag.outputs.prerelease == 'true' && '--prerelease' }}
94+ LATEST_ARG : ${{ steps.dist-tag.outputs.latest == 'true' && '--latest' }}
8895 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8996 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments