Skip to content

ci(homebrew): handle existing upstream remote and main base#1385

Merged
willsarg merged 1 commit intomainfrom
codex/homebrew-secret-fallback
Feb 22, 2026
Merged

ci(homebrew): handle existing upstream remote and main base#1385
willsarg merged 1 commit intomainfrom
codex/homebrew-secret-fallback

Conversation

@willsarg
Copy link
Collaborator

Fix Homebrew publish failure when upstream remote already exists after fork clone, and target upstream main branch with master fallback for fetch.

Copilot AI review requested due to automatic review settings February 22, 2026 10:16
@github-actions
Copy link

PR intake checks found warnings (non-blocking)

Fast safe checks found advisory issues. CI lint/test/build gates still enforce merge quality.

  • Missing required PR template sections: ## Summary, ## Validation Evidence (required), ## Security Impact (required), ## Privacy and Data Hygiene (required), ## Rollback Plan (required)
  • Incomplete required PR template fields: summary problem, summary why it matters, summary what changed, validation commands, security risk/mitigation, privacy status, rollback plan

Action items:

  1. Complete required PR template sections/fields.
  2. Remove tabs, trailing whitespace, and merge conflict markers from added lines.
  3. Re-run local checks before pushing:
    • ./scripts/ci/rust_quality_gate.sh
    • ./scripts/ci/rust_strict_delta_gate.sh
    • ./scripts/ci/docs_quality_gate.sh

Run logs: https://github.com/zeroclaw-labs/zeroclaw/actions/runs/22275210822

Detected blocking line issues (sample):

  • none

Detected advisory line issues (sample):

  • none

Workflow files changed in this PR:

  • .github/workflows/pub-homebrew-core.yml

Reminder: workflow changes require owner approval via CI Required Gate.

@willsarg willsarg merged commit c47fb22 into main Feb 22, 2026
12 of 13 checks passed
@github-actions github-actions bot added ci Auto scope: CI/workflow/hook files changed. size: XS Auto size: <=80 non-doc changed lines. risk: high Auto risk: security/runtime/gateway/tools/workflows. distinguished contributor Contributor with 50+ merged PRs. labels Feb 22, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Homebrew CI workflow to handle cases where the upstream remote already exists when cloning a fork, and implements dynamic detection of the upstream repository's default branch (main vs master). The changes address failures in the Homebrew publish workflow when working with forked repositories.

Changes:

  • Add logic to handle existing upstream remote by using set-url instead of add
  • Dynamically detect whether upstream uses "main" or "master" branch
  • Update branch checkout and PR creation to use detected branch name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

gh pr create \
--repo "$UPSTREAM_REPO" \
--base master \
--base main \
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

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

The PR base branch is hardcoded to "main" but the earlier logic detects whether the upstream uses "main" or "master" and stores it in the upstream_ref variable. However, upstream_ref is a local variable in the patch_formula step and is not available in this later push-and-PR step. This creates an inconsistency: the branch is created based on the detected upstream_ref (line 146), but the PR always targets "main" regardless of what was detected.

If the upstream repository still uses "master", this will cause the PR creation to fail because the base branch won't exist or won't match the branch that was actually checked out.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Auto scope: CI/workflow/hook files changed. distinguished contributor Contributor with 50+ merged PRs. risk: high Auto risk: security/runtime/gateway/tools/workflows. size: XS Auto size: <=80 non-doc changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants