Skip to content

fix: fetch fork PR heads in benchmark workflow#7763

Closed
RedZapdos123 wants to merge 1 commit into
tobymao:mainfrom
RedZapdos123:fix-benchmark-fork-pr
Closed

fix: fetch fork PR heads in benchmark workflow#7763
RedZapdos123 wants to merge 1 commit into
tobymao:mainfrom
RedZapdos123:fix-benchmark-fork-pr

Conversation

@RedZapdos123

@RedZapdos123 RedZapdos123 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Description:

Issue #7762 reported that the benchmark workflow fails for fork pull requests because it resolves the PR head ref and then tries to fetch that branch from origin, which only contains branches from tobymao/sqlglot.

This PR updates .github/workflows/benchmark-sqlglot.yml to resolve the PR head repository clone URL and head ref from the pull request API, then fetches that ref directly and checks out FETCH_HEAD.

This keeps the workflow behavior the same for same-repository pull requests and fixes the checkout path for fork pull requests.

Closes #7762.

Checklist:

  • I have verified the failure locally against a fork pull request by reproducing git fetch origin "$PR_HEAD" failing for PR clickhouse: parse documented SHOW and EXPLAIN statements #7670.
  • I have verified the fix locally by fetching the PR head repository clone URL and ref from the pull request API and checking out FETCH_HEAD successfully.
  • I have run validation with make check.

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the /benchmark GitHub Actions workflow for fork-based pull requests by fetching the PR head from the PR’s actual head repository/ref (instead of assuming the branch exists on origin in tobymao/sqlglot).

Changes:

  • Resolve PR head clone_url and ref via the pull request API.
  • Fetch the PR head directly and check out FETCH_HEAD to run benchmarks on fork PRs.

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

Comment on lines +27 to +30
PR_HEAD_REPO=$(gh api "repos/${{ github.repository }}/pulls/$PR_NUMBER" --jq '.head.repo.clone_url')
PR_HEAD_REF=$(gh api "repos/${{ github.repository }}/pulls/$PR_NUMBER" --jq '.head.ref')
git fetch "$PR_HEAD_REPO" "$PR_HEAD_REF"
git checkout FETCH_HEAD
@georgesittas

georgesittas commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

I don't want to risk getting this in given #7763 (comment). There is a make bench command you can run locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Benchmark workflow fails for fork pull requests

3 participants