ci: fix docker-build-check for PRs from forks#654
Merged
Conversation
Contributor
There was a problem hiding this comment.
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_URLto usegithub.event.pull_request.head.repo.clone_urlfor PR events, with a fallback to the base repo URL forpushevents. - 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.
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.
2a86306 to
4d2d9da
Compare
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
docker-build-check.ymlpassesDSTACK_SRC_URL=${{ github.server_url }}/${{ github.repository }}to the Dockerfile, which is always the base repo (Dstack-TEE/dstack). The Dockerfile then runsgit clone $DSTACK_SRC_URL && git checkout $DSTACK_REV.DSTACK_REVis the fork's head SHA, which does not exist in the base repo yet, so the checkout fails withfatal: unable to read tree. Seen on feature: TLS passthrough will select known app_id from TXT record w multiple entries #653.DSTACK_SRC_URLtogithub.event.pull_request.head.repo.clone_urlwhen it's set (fork PRs and same-repo PRs), falling back to the base repo URL forpushevents. The 7 occurrences across the gateway / kms / verifier jobs are all updated.Test plan
git checkoutstep.