From 12e2648a4a2730aace015ba1e50f32003808c5be Mon Sep 17 00:00:00 2001 From: Sam Starling <42478+samstarling@users.noreply.github.com> Date: Thu, 30 Apr 2026 12:06:35 +0100 Subject: [PATCH] chore: Fix Homebrew release token usage --- .github/workflows/release.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ceaa4e0..2ee7a36 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,15 +15,28 @@ jobs: runs-on: ubuntu-latest steps: + - name: Generate release app token + id: app-token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.RELEASE_APP_ID }} + private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} + owner: semaloop + repositories: | + cli + homebrew-tap + - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 + token: ${{ steps.app-token.outputs.token }} + persist-credentials: true - name: Configure git run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config user.name "${{ steps.app-token.outputs.app-slug }}[bot]" + git config user.email "${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com" - name: Setup Go uses: actions/setup-go@v5 @@ -46,7 +59,7 @@ jobs: - name: Release id: semantic-release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} run: | npx semantic-release | tee /tmp/semantic-release.log if grep -q "Published release" /tmp/semantic-release.log; then @@ -59,5 +72,5 @@ jobs: with: args: release --clean env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} + HOMEBREW_TAP_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}