Skip to content

Publish releases with the automatic token when no PAT is configured - #2

Merged
dallasbpeters merged 1 commit into
mainfrom
rolemodel/release-token
Aug 24, 2026
Merged

Publish releases with the automatic token when no PAT is configured#2
dallasbpeters merged 1 commit into
mainfrom
rolemodel/release-token

Conversation

@dallasbpeters

Copy link
Copy Markdown
Member

The v0.0.1 build succeeded and then failed to publish:

GH_TOKEN:
gh: To use GitHub CLI in a GitHub Actions workflow, set the GH_TOKEN environment variable.
##[error]Process completed with exit code 4.

So installers for 0.0.1 exist as workflow artifacts, and there is no release holding
them — which is why the cask still reads 0.0.0-unreleased.

Both publish steps read secrets.OPENSCREEN_RELEASE_TOKEN, which upstream configures
and this fork does not. Every other step uses secrets.GITHUB_TOKEN and works. A PAT
is only needed to reach another repository or to trigger a further workflow;
publishing a release here needs contents: write, which the workflow already grants
at the top level.

${{ secrets.OPENSCREEN_RELEASE_TOKEN || secrets.GITHUB_TOKEN }} prefers the PAT when
it exists and falls back otherwise, so the fork publishes without anyone creating a
secret and upstream's arrangement keeps working where the secret is set.

🤖 Generated with Claude Code

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) <noreply@anthropic.com>
@dallasbpeters
dallasbpeters merged commit d610e2f into main Aug 24, 2026
13 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant