File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545 SIRE_SILENT_PHONEHOME : 1
4646 SIRE_EMLE : 1
4747 REPO : " ${{ github.event.pull_request.head.repo.full_name || github.repository }}"
48+ SIRE_REMOTE : " https://github.com/${{ github.event.pull_request.head.repo.full_name || github.repository }}.git"
4849 steps :
4950 #
5051 - uses : actions/checkout@v4
Original file line number Diff line number Diff line change @@ -91,11 +91,20 @@ def get_git_info(srcdir):
9191 """Get the git remote URL and branch/tag."""
9292 gitdir = os .path .join (srcdir , ".git" )
9393
94- remote = run_cmd (
95- f"git --git-dir={ gitdir } --work-tree={ srcdir } config --get remote.origin.url"
96- )
97- if not remote .endswith (".git" ):
98- remote += ".git"
94+ # For PR builds from external forks the checkout remote points to the base
95+ # repo, not the fork. The workflow sets SIRE_REMOTE to the fork's clone
96+ # URL so that rattler-build fetches from the right place.
97+ env_remote = os .environ .get ("SIRE_REMOTE" )
98+ if env_remote :
99+ remote = env_remote
100+ if not remote .endswith (".git" ):
101+ remote += ".git"
102+ else :
103+ remote = run_cmd (
104+ f"git --git-dir={ gitdir } --work-tree={ srcdir } config --get remote.origin.url"
105+ )
106+ if not remote .endswith (".git" ):
107+ remote += ".git"
99108
100109 branch = run_cmd (
101110 f"git --git-dir={ gitdir } --work-tree={ srcdir } rev-parse --abbrev-ref HEAD"
You can’t perform that action at this time.
0 commit comments