From e3faa35de95a1861ec88b4c05bd5df422177cfca Mon Sep 17 00:00:00 2001 From: Andrew Farries Date: Fri, 8 Dec 2023 15:46:55 +0000 Subject: [PATCH] Use org-level `GIT_TOKEN` for brew tap update (#215) As described in the GoReleaser docs: https://goreleaser.com/errors/resource-not-accessible-by-integration/ --- .github/workflows/build.yml | 5 +++++ .goreleaser.yaml | 1 + 2 files changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e814a82c..bda86b15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -139,6 +139,11 @@ jobs: version: latest args: release --clean env: + # We use two github tokens here: + # * The actions-bound `GITHUB_TOKEN` with permissions to write packages. + # * The org level `GIT_TOKEN` to be able to publish the brew tap file. + # See: https://goreleaser.com/errors/resource-not-accessible-by-integration/ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAP_GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} GITHUB_USERNAME: ${{ github.repository_owner }} DOCKER_USERNAME: ghcr.io/${{ github.repository_owner }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d4625213..ea365ac0 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -31,6 +31,7 @@ brews: description: "Postgres zero-downtime migrations made easy" license: "Apache-2.0" repository: + token: "{{ .Env.TAP_GITHUB_TOKEN }}" owner: "{{ .Env.GITHUB_USERNAME }}" name: homebrew-pgroll