@@ -27,7 +27,9 @@ name: Release
2727# Without it the release does NOT build: an ad-hoc signature changes the
2828# app's identity on every release and macOS revokes Full Disk Access after
2929# every upgrade.
30- # HOMEBREW_TAP_TOKEN - token with write access to RenaCode/homebrew-tap.
30+ # TAP_APP_KEY (secret) + TAP_APP_CLIENT_ID (variable) - GitHub App `renacode-tap`
31+ # (Contents: write, installed on RenaCode/homebrew-tap). The job mints a
32+ # 1-hour token scoped to that one repository; nothing expires.
3133#
3234# Still no Developer ID and no notarization - Gatekeeper does not know the
3335# publisher; the cask removes the quarantine attribute in postflight.
@@ -277,23 +279,41 @@ jobs:
277279 mac-app/build/*.sha256
278280 generate_release_notes : true
279281
280- - name : Check tap token
282+ - name : Check tap app
281283 if : env.IS_RELEASE == 'true'
282284 env :
283- TAP_TOKEN : ${{ secrets.HOMEBREW_TAP_TOKEN }}
285+ TAP_APP_CLIENT_ID : ${{ vars.TAP_APP_CLIENT_ID }}
286+ TAP_APP_KEY : ${{ secrets.TAP_APP_KEY }}
284287 run : |
285- if [ -z "$TAP_TOKEN " ]; then
286- echo "::error::Release published, but HOMEBREW_TAP_TOKEN is missing - the cask in the tap was NOT updated. Contents to insert manually:"
288+ if [ -z "$TAP_APP_CLIENT_ID" ] || [ -z "$TAP_APP_KEY " ]; then
289+ echo "::error::Release published, but TAP_APP_CLIENT_ID/TAP_APP_KEY is missing - the cask in the tap was NOT updated. Contents to insert manually:"
287290 cat mac-app/build/cloudmachine.rb
288291 exit 1
289292 fi
290293
294+ # Token and the access probe run on EVERY build, not only on release:
295+ # an app that lost its installation (or a missing key) fails the PR,
296+ # not the release after the DMG is already published.
297+ - name : Tap token
298+ id : tap-token
299+ uses : actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
300+ with :
301+ client-id : ${{ vars.TAP_APP_CLIENT_ID }}
302+ private-key : ${{ secrets.TAP_APP_KEY }}
303+ owner : RenaCode
304+ repositories : homebrew-tap
305+
306+ - name : Check tap access
307+ env :
308+ TAP_TOKEN : ${{ steps.tap-token.outputs.token }}
309+ run : git ls-remote "https://x-access-token:${TAP_TOKEN}@github.com/RenaCode/homebrew-tap.git" HEAD
310+
291311 - name : Check out tap
292312 if : env.IS_RELEASE == 'true'
293313 uses : actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
294314 with :
295315 repository : RenaCode/homebrew-tap
296- token : ${{ secrets.HOMEBREW_TAP_TOKEN }}
316+ token : ${{ steps.tap-token.outputs.token }}
297317 path : homebrew-tap
298318
299319 - name : Push cask to tap
0 commit comments