From 459d007978bcb9ac338afd27099f36598a20d344 Mon Sep 17 00:00:00 2001 From: dallasbpeters Date: Mon, 24 Aug 2026 08:52:11 -0500 Subject: [PATCH] Fall back to the automatic token when publishing a release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The v0.0.1 build succeeded and then failed to publish: `GH_TOKEN:` was empty and `gh release create` exited 4 with GitHub's own hint — "set the GH_TOKEN environment variable". So there are installers for 0.0.1 and no release holding them, which is why the cask still cannot be pointed anywhere. Both publish steps read `secrets.OPENSCREEN_RELEASE_TOKEN`, which upstream configures and this fork does not. Every other step in the workflow uses `secrets.GITHUB_TOKEN` and works. A PAT is only needed to reach *another* repository or to trigger a further workflow; publishing a release to this one needs `contents: write`, which the workflow already grants at the top level. So the PAT is preferred when present and the automatic token is used when it is not. That makes the fork publish without anyone having to create a secret first, and leaves upstream's arrangement working wherever the secret does exist. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d22fefa94..756356bce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -907,7 +907,7 @@ jobs: - name: Publish release assets env: - GH_TOKEN: ${{ secrets.OPENSCREEN_RELEASE_TOKEN }} + GH_TOKEN: ${{ secrets.OPENSCREEN_RELEASE_TOKEN || secrets.GITHUB_TOKEN }} TAG: ${{ steps.release.outputs.tag }} PRERELEASE_FLAG: ${{ steps.release.outputs.prerelease_flag }} NOTES_START_TAG: ${{ steps.release.outputs.notes_start_tag }} @@ -1000,7 +1000,7 @@ jobs: if: ${{ steps.release.outputs.is_prerelease == 'false' }} timeout-minutes: 20 env: - GH_TOKEN: ${{ secrets.OPENSCREEN_RELEASE_TOKEN }} + GH_TOKEN: ${{ secrets.OPENSCREEN_RELEASE_TOKEN || secrets.GITHUB_TOKEN }} run: | latest_dispatch() { gh run list \