diff --git a/.github/workflows/prepare-publish.yml b/.github/workflows/prepare-publish.yml index 615ccd89e..f57bd9c85 100644 --- a/.github/workflows/prepare-publish.yml +++ b/.github/workflows/prepare-publish.yml @@ -79,8 +79,10 @@ jobs: - id: generate-token uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 with: - app-id: ${{ secrets.RELEASE_GITHUB_APP_ID }} + client-id: ${{ secrets.RELEASE_GITHUB_APP_ID }} private-key: ${{ secrets.RELEASE_GITHUB_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + repositories: ${{ github.event.repository.name }} permission-contents: write permission-pull-requests: write @@ -96,4 +98,4 @@ jobs: --base "$TARGET_BRANCH" \ --head "$PREPARE_BRANCH" \ --title "chore: release v$VERSION" \ - --body "Release PR generated by the Prepare Publish workflow." + --body "Release PR generated by the Prepare Publish workflow: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8dbecf4c0..e7644aced 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -115,16 +115,25 @@ jobs: PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN: 'false' run: pnpm run publish-ci "$VERSION" + - id: generate-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + with: + client-id: ${{ secrets.RELEASE_GITHUB_APP_ID }} + private-key: ${{ secrets.RELEASE_GITHUB_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + repositories: ${{ github.event.repository.name }} + permission-contents: write + - name: Push release tag env: VERSION: ${{ needs.detect.outputs.version }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ steps.generate-token.outputs.token }} run: | TAG="v$VERSION" - git config user.name "vitest-release-bot" - git config user.email "actions@github.com" + git config user.name "vitest-release-bot[bot]" + git config user.email "292707936+vitest-release-bot[bot]@users.noreply.github.com" git tag "$TAG" "$GITHUB_SHA" - git push "https://x-access-token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git" "$TAG" + git push "https://x-access-token:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.git" "$TAG" - name: Generate Changelog env: