From f89c1fa63711bee416cbde215090473267f0a5b9 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Sun, 15 Nov 2026 20:52:56 -0500 Subject: [PATCH] ci: update the Homebrew cask with the coder-package-publisher App The cask update mints a coder-package-publisher App token (contents and pull requests write on coder/homebrew-coder only) instead of using CODERCI_GITHUB_TOKEN. The job runs in the release-publish environment, which holds the App key, accepts only v* tags and needs a release manager's approval. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 38d3f208..ce0b0458 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -110,6 +110,8 @@ jobs: runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-26' || 'macos-26'}} if: ${{ github.repository_owner == 'coder' && github.event_name == 'release' }} needs: build + # Holds the coder-package-publisher App key; release tags only, approved by a release manager. + environment: release-publish steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -121,9 +123,20 @@ jobs: - name: Setup Nix uses: ./.github/actions/nix-devshell + - name: Generate coder-package-publisher App token + id: publisher_token + uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 + with: + app-id: ${{ secrets.CODER_PACKAGE_PUBLISHER_APP_ID }} + private-key: ${{ secrets.CODER_PACKAGE_PUBLISHER_APP_PRIVATE_KEY }} + owner: coder + repositories: homebrew-coder + permission-contents: write + permission-pull-requests: write + - name: Update homebrew-coder env: - GH_TOKEN: ${{ secrets.CODERCI_GITHUB_TOKEN }} + GH_TOKEN: ${{ steps.publisher_token.outputs.token }} RELEASE_TAG: ${{ github.event.release.tag_name }} ASSIGNEE: ${{ github.actor }} run: |