Setup git user in the release script (#686)

* Setup git user in the release script

* refactor stuff
This commit is contained in:
Mateusz Burzyński
2026-07-01 13:29:33 +00:00
committed by GitHub
parent 4b6e1f1099
commit e43c867727
2 changed files with 19 additions and 23 deletions
+12 -11
View File
@@ -62,8 +62,8 @@ jobs:
- name: Build - name: Build
run: pnpm build run: pnpm build
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 - uses: ./.github/actions/setup-bot-auth
id: app-token id: bot-auth
with: with:
client-id: ${{ vars.APP_CLIENT_ID }} client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }} private-key: ${{ secrets.APP_PRIVATE_KEY }}
@@ -74,7 +74,8 @@ jobs:
id: changesets id: changesets
uses: ./version uses: ./version
with: with:
github-token: ${{ steps.app-token.outputs.token }} github-token: ${{ steps.bot-auth.outputs.token }}
setup-git-user: false
script: pnpm bump script: pnpm bump
publish: publish:
@@ -87,13 +88,6 @@ jobs:
permissions: permissions:
contents: write # to create release and have it authored by github-actions (changesets/action) contents: write # to create release and have it authored by github-actions (changesets/action)
steps: steps:
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: app-token
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
permission-contents: write # to bypass branch and tag protection rules (release.ts)
- name: Check out repo - name: Check out repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with: with:
@@ -106,8 +100,15 @@ jobs:
- name: Build - name: Build
run: pnpm build run: pnpm build
- uses: ./.github/actions/setup-bot-auth
id: bot-auth
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
permission-contents: write # to bypass branch and tag protection rules (release.ts)
- name: Publish to marketplace - name: Publish to marketplace
uses: ./publish uses: ./publish
with: with:
github-token: ${{ steps.app-token.outputs.token }} github-token: ${{ steps.bot-auth.outputs.token }}
script: pnpm release script: pnpm release
+7 -12
View File
@@ -122,13 +122,6 @@ jobs:
pull-requests: write # to comment on the pull request with the release result (changesets/action) pull-requests: write # to comment on the pull request with the release result (changesets/action)
steps: steps:
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: app-token
with:
client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
permission-contents: write # to push the release snapshot branch (release-pr.ts)
- name: Check out repo - name: Check out repo
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with: with:
@@ -173,15 +166,17 @@ jobs:
- name: Build - name: Build
run: pnpm build run: pnpm build
- name: Setup Git user - uses: ./.github/actions/setup-bot-auth
run: | id: bot-auth
git config --global user.name "github-actions[bot]" with:
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" client-id: ${{ vars.APP_CLIENT_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
permission-contents: write # to push the release snapshot branch (release-pr.ts)
- name: Release snapshot version - name: Release snapshot version
run: pnpm release:pr run: pnpm release:pr
env: env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} GITHUB_TOKEN: ${{ steps.bot-auth.outputs.token }}
- name: Add success reaction - name: Add success reaction
run: gh api "/repos/$GH_REPO/issues/comments/$COMMENT_ID/reactions" -f content='rocket' run: gh api "/repos/$GH_REPO/issues/comments/$COMMENT_ID/reactions" -f content='rocket'