Fix Homebrew tap auto-update workflow#56
Conversation
The job-level `if: ${{ secrets.HOMEBREW_TAP_TOKEN != '' }}` breaks
workflow parsing. Secrets context isn't reliably available in job-level
if conditions. Move to a step-level check instead.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical workflow parsing issue that prevented the release workflow from running when tags are pushed. The issue stemmed from using a job-level if condition that checks for secret existence, which breaks GitHub Actions workflow parsing.
Changes:
- Removed job-level
ifcondition onupdate-homebrewjob that was checking forHOMEBREW_TAP_TOKENsecret - Added a dedicated "Check for tap token" step that sets a
skipoutput variable when the token is missing - Added conditional
if: steps.check_token.outputs.skip != 'true'guards to all subsequent steps in the job
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| run: | | ||
| if [ -z "$TOKEN" ]; then | ||
| echo "HOMEBREW_TAP_TOKEN not set, skipping homebrew update" | ||
| echo "skip=true" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
The skip logic has an issue: when the TOKEN is set (not empty), the skip output variable is never set, so it will be empty/undefined. This means subsequent steps checking steps.check_token.outputs.skip != 'true' will pass when the token exists (correct), but for the wrong reason (the output is undefined, not 'false').
To make the logic clearer and more robust, you should explicitly set the skip value for both cases. Add an else clause to set skip=false when the token exists.
| echo "skip=true" >> $GITHUB_OUTPUT | |
| echo "skip=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "skip=false" >> $GITHUB_OUTPUT |
Summary
ifto step-level checkif: ${{ secrets.HOMEBREW_TAP_TOKEN != '' }}breaks workflow parsing entirely, preventing the release workflow from running on tag pushesTest plan
Generated with Claude Code