From 058e4a66851a76a18e0ab9b28feb7809774797e6 Mon Sep 17 00:00:00 2001 From: Teakowa <27560638+Teakowa@users.noreply.github.com> Date: Tue, 18 Aug 2026 19:15:37 +0800 Subject: [PATCH] fix(release): use organization token for release PR Refs #169 --- .github/workflows/release-please.yml | 8 +++++--- docs/release.md | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index efd3288..f126f84 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -29,19 +29,21 @@ jobs: with: fetch-depth: 0 persist-credentials: true - token: ${{ github.token }} + token: ${{ secrets.GH_TOKEN }} - name: Run release-please id: release uses: googleapis/release-please-action@v4 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} with: - token: ${{ github.token }} + token: ${{ secrets.GH_TOKEN }} config-file: release-please-config.json manifest-file: .release-please-manifest.json - name: Synchronize checked-in release metadata env: - GH_TOKEN: ${{ github.token }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} PR: ${{ steps.release.outputs.pr }} run: | set -euo pipefail diff --git a/docs/release.md b/docs/release.md index d50ad99..1e4ec06 100644 --- a/docs/release.md +++ b/docs/release.md @@ -137,9 +137,9 @@ before attaching them to the draft Release. ### Repository configuration -Enable Actions to create and approve pull requests, and grant the default -repository `GITHUB_TOKEN` `contents: write`, `issues: write`, and -`pull-requests: write` for the release-please workflow. The reusable distribution workflow also needs +Enable Actions to create and approve pull requests. The release-please workflow +uses the repository's `GH_TOKEN` secret as `GITHUB_TOKEN` so it can create and +update the Release PR. The reusable distribution workflow also needs `id-token: write` for npm provenance and `packages: write` for GitHub Packages. Create a protected `release` environment if publication approval is required; the final `publish-release` job is the only job that uses it.