Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,25 @@ jobs:
update-homebrew:
needs: release
runs-on: ubuntu-latest
if: ${{ secrets.HOMEBREW_TAP_TOKEN != '' }}

steps:
- name: Check for tap token
id: check_token
env:
TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
run: |
if [ -z "$TOKEN" ]; then
echo "HOMEBREW_TAP_TOKEN not set, skipping homebrew update"
echo "skip=true" >> $GITHUB_OUTPUT
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
echo "skip=true" >> $GITHUB_OUTPUT
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "skip=false" >> $GITHUB_OUTPUT

Copilot uses AI. Check for mistakes.
fi

- name: Extract version from tag
if: steps.check_token.outputs.skip != 'true'
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT

- name: Wait for PyPI to index
if: steps.check_token.outputs.skip != 'true'
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
for i in $(seq 1 30); do
Expand All @@ -76,6 +87,7 @@ jobs:
exit 1

- name: Get sdist URL and SHA256
if: steps.check_token.outputs.skip != 'true'
id: pypi
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
Expand All @@ -86,12 +98,14 @@ jobs:
echo "SHA=${SHA}" >> $GITHUB_OUTPUT

- name: Checkout homebrew tap
if: steps.check_token.outputs.skip != 'true'
uses: actions/checkout@v4
with:
repository: turlockmike/homebrew-murl
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}

- name: Update formula
if: steps.check_token.outputs.skip != 'true'
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
URL="${{ steps.pypi.outputs.URL }}"
Expand All @@ -103,6 +117,7 @@ jobs:
sed -i "s|murl version [0-9.]*|murl version ${VERSION}|" Formula/murl.rb

- name: Commit and push
if: steps.check_token.outputs.skip != 'true'
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
git config user.name "github-actions[bot]"
Expand Down