Publish releases with the automatic token when no PAT is configured - #2
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The v0.0.1 build succeeded and then failed to publish:
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 configuresand this fork does not. Every other step uses
secrets.GITHUB_TOKENand works. A PATis only needed to reach another repository or to trigger a further workflow;
publishing a release here needs
contents: write, which the workflow already grantsat the top level.
${{ secrets.OPENSCREEN_RELEASE_TOKEN || secrets.GITHUB_TOKEN }}prefers the PAT whenit 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