Skip to content

ci: fix docker-build-check for PRs from forks#654

Merged
kvinwang merged 1 commit intomasterfrom
fix/docker-build-check-fork-prs
Apr 22, 2026
Merged

ci: fix docker-build-check for PRs from forks#654
kvinwang merged 1 commit intomasterfrom
fix/docker-build-check-fork-prs

Conversation

@kvinwang
Copy link
Copy Markdown
Collaborator

Summary

  • docker-build-check.yml passes DSTACK_SRC_URL=${{ github.server_url }}/${{ github.repository }} to the Dockerfile, which is always the base repo (Dstack-TEE/dstack). The Dockerfile then runs git clone $DSTACK_SRC_URL && git checkout $DSTACK_REV.
  • For PRs from forks, DSTACK_REV is the fork's head SHA, which does not exist in the base repo yet, so the checkout fails with fatal: unable to read tree. Seen on feature: TLS passthrough will select known app_id from TXT record w multiple entries #653.
  • This PR switches DSTACK_SRC_URL to github.event.pull_request.head.repo.clone_url when it's set (fork PRs and same-repo PRs), falling back to the base repo URL for push events. The 7 occurrences across the gateway / kms / verifier jobs are all updated.

Test plan

Copilot AI review requested due to automatic review settings April 22, 2026 00:55
Copy link
Copy Markdown
Contributor

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

Updates the Docker Build Check GitHub Actions workflow so PR builds clone the correct source repository when the PR originates from a fork (avoiding checkout failures when the head SHA doesn’t exist in the base repo).

Changes:

  • Switch DSTACK_SRC_URL to use github.event.pull_request.head.repo.clone_url for PR events, with a fallback to the base repo URL for push events.
  • Apply the update consistently across the gateway, kms, and verifier build-check steps.

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

Comment thread .github/workflows/docker-build-check.yml Outdated
When a PR comes from a fork, the head SHA doesn't exist in the base
repo yet, so `git clone <base> && git checkout <head-sha>` inside the
Docker builder fails with "unable to read tree". Pick the head repo's
clone_url when it's available, and fall back to the base repo URL for
push events.
@kvinwang kvinwang force-pushed the fix/docker-build-check-fork-prs branch from 2a86306 to 4d2d9da Compare April 22, 2026 01:07
@kvinwang kvinwang enabled auto-merge April 22, 2026 01:13
@kvinwang kvinwang merged commit 5e4ec90 into master Apr 22, 2026
15 checks passed
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.

2 participants