Conversation
After PyPI publish, a new job: 1. Waits for PyPI to index the new version 2. Fetches sdist URL + SHA256 3. Updates Formula/murl.rb in turlockmike/homebrew-murl 4. Pushes directly to the tap repo Requires HOMEBREW_TAP_TOKEN secret (PAT with repo scope). Skips gracefully if secret is not set. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds an automated post-release step to keep the Homebrew tap formula in sync with newly published PyPI releases, so Homebrew users can install the latest version without manual formula edits.
Changes:
- Adds a new
update-homebrewworkflow job that runs after thereleasejob completes. - Polls PyPI for the new version, extracts the sdist URL + SHA256, and updates the tap’s
Formula/murl.rb. - Commits and pushes the formula update directly to
turlockmike/homebrew-murlwhenHOMEBREW_TAP_TOKENis configured.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| update-homebrew: | ||
| needs: release | ||
| runs-on: ubuntu-latest | ||
| if: ${{ secrets.HOMEBREW_TAP_TOKEN != '' }} | ||
|
|
There was a problem hiding this comment.
The new update-homebrew job inherits the workflow-level id-token: write permission, but it doesn’t use OIDC. Consider setting job-level permissions for update-homebrew (e.g., contents: read) and/or moving id-token: write to the release job only, to follow least-privilege for the added PAT-based push job.
| - name: Get sdist URL and SHA256 | ||
| id: pypi | ||
| run: | | ||
| VERSION=${{ steps.get_version.outputs.VERSION }} | ||
| JSON=$(curl -sf "https://pypi.org/pypi/mcp-curl/${VERSION}/json") | ||
| URL=$(echo "$JSON" | python3 -c "import sys,json; d=json.load(sys.stdin); print([u['url'] for u in d['urls'] if u['packagetype']=='sdist'][0])") | ||
| SHA=$(echo "$JSON" | python3 -c "import sys,json; d=json.load(sys.stdin); print([u['digests']['sha256'] for u in d['urls'] if u['packagetype']=='sdist'][0])") |
There was a problem hiding this comment.
python3 is used to parse the PyPI JSON, but this job doesn’t set up Python. While ubuntu-latest currently includes Python, pinning via actions/setup-python (or using a tool like jq) would make this job more reliable against runner image changes.
| - name: Get sdist URL and SHA256 | |
| id: pypi | |
| run: | | |
| VERSION=${{ steps.get_version.outputs.VERSION }} | |
| JSON=$(curl -sf "https://pypi.org/pypi/mcp-curl/${VERSION}/json") | |
| URL=$(echo "$JSON" | python3 -c "import sys,json; d=json.load(sys.stdin); print([u['url'] for u in d['urls'] if u['packagetype']=='sdist'][0])") | |
| SHA=$(echo "$JSON" | python3 -c "import sys,json; d=json.load(sys.stdin); print([u['digests']['sha256'] for u in d['urls'] if u['packagetype']=='sdist'][0])") | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Get sdist URL and SHA256 | |
| id: pypi | |
| run: | | |
| VERSION=${{ steps.get_version.outputs.VERSION }} | |
| JSON=$(curl -sf "https://pypi.org/pypi/mcp-curl/${VERSION}/json") | |
| URL=$(echo "$JSON" | python3 -c "import sys,json; d=json.load(sys.stdin); print([u['url'] for u in d['urls'] if u['packagetype']=='sdist'][0])") | |
| SHA$(echo "$JSON" | python3 -c "import sys,json; d=json.load(sys.stdin); print([u['digests']['sha256'] for u in d['urls'] if u['packagetype']=='sdist'][0])") |
| git add Formula/murl.rb | ||
| git commit -m "Update murl to ${VERSION}" | ||
| git push |
There was a problem hiding this comment.
git commit will fail the job with a non-zero exit code when there are no changes (e.g., rerunning the workflow for the same tag, or if the formula was already updated). Add a guard like checking for a clean diff before committing, or allow the no-op commit case to exit successfully.
Summary
Formula/murl.rbturlockmike/homebrew-murlSetup required
Add a
HOMEBREW_TAP_TOKENsecret — a GitHub PAT withreposcope forturlockmike/homebrew-murl. Skips gracefully if not configured.Test plan
releasecompleting first🤖 Generated with Claude Code