ci(release): fix Homebrew bot identity lookup quoting - #51
Merged
Conversation
Use a multiline script so nested quotes do not break gh api, and fail if the resolved user id is not numeric. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a quoting bug in the Homebrew release workflow by replacing an inline echo "user-id=$(...)” with a multiline script, ensuring the gh api call is correctly quoted and the resolved bot user ID is validated as numeric before being written to $GITHUB_OUTPUT.
Changes:
- Switch the “Resolve Homebrew release bot user ID” step to a multiline
run: |script to avoid nested-quote breakage. - Add
set -euo pipefailand validate thegh api-returned.idis digits-only, failing fast otherwise. - Pass the app slug via
APP_SLUGenv var to simplify and harden the command construction.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Test plan
Review aids
Before:
echo "user-id=$(gh api "/users/...")"(broken nested quotes)After: multiline
run: |with numeric validationMade with Cursor
Summary by cubic
Fix the Homebrew release bot user ID lookup in CI by switching to a multiline script with safe quoting and numeric validation. Prevents broken
gh apicalls and fails fast if the ID isn’t numeric.run: |withset -euo pipefailto avoid nested-quote issues ingh api./users/${APP_SLUG}[bot], validate the ID is digits only, then writeuser-idto$GITHUB_OUTPUT.Written for commit 71246ca. Summary will update on new commits.