Skip to content

Commit 838dc50

Browse files
committed
git-artifacts: allow building in a fork
When building in a fork of `git-for-windows-automation`, we should also pull the `git-sdk-32`, `git-sdk-64`, `build-extra` and `MINGW-packages` repositories from the same user's (or org's) forked repositories. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 638108d commit 838dc50

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

.github/workflows/git-artifacts.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ env:
3232
USERPROFILE: "${{github.workspace}}\\home"
3333
ARTIFACTS_TO_BUILD: "${{github.event.inputs.artifacts}}"
3434
ARCHITECTURE: "${{github.event.inputs.architecture}}"
35-
OWNER: git-for-windows
35+
OWNER: ${{ github.repository_owner }}
3636
REPO: git
3737
TAG_GIT_WORKFLOW_RUN_ID: "${{github.event.inputs.tag_git_workflow_run_id}}"
3838
EXISTING_GIT_TAG: "${{github.event.inputs.existing_git_tag}}"
@@ -230,7 +230,7 @@ jobs:
230230
run: |
231231
git -c checkout.workers=56 \
232232
clone --single-branch -b "$RELEASE_BRANCH" --depth 1 \
233-
https://github.com/git-for-windows/git-sdk-$SDK_REPO_ARCH D:/git-sdk-$SDK_REPO_ARCH &&
233+
https://github.com/$OWNER/git-sdk-$SDK_REPO_ARCH D:/git-sdk-$SDK_REPO_ARCH &&
234234
235235
cygpath -aw D:/git-sdk-$SDK_REPO_ARCH/usr/bin/core_perl >>$GITHUB_PATH &&
236236
cygpath -aw D:/git-sdk-$SDK_REPO_ARCH/usr/bin >>$GITHUB_PATH &&
@@ -261,32 +261,33 @@ jobs:
261261
d=/usr/src/build-extra &&
262262
if test ! -d $d/.git
263263
then
264-
git clone --single-branch -b "$RELEASE_BRANCH" https://github.com/git-for-windows/build-extra $d
264+
git clone --single-branch -b "$RELEASE_BRANCH" https://github.com/$OWNER/build-extra $d
265265
else
266-
git -C $d fetch https://github.com/git-for-windows/build-extra "$RELEASE_BRANCH" &&
266+
git -C $d fetch https://github.com/$OWNER/build-extra "$RELEASE_BRANCH" &&
267267
git -C $d switch -C "$RELEASE_BRANCH" FETCH_HEAD
268268
fi &&
269269
if test -z "$EXISTING_GIT_TAG"
270270
then
271271
git -C $d -c pull.rebase=false pull "$PWD"/bundle-artifacts/build-extra.bundle "$RELEASE_BRANCH"
272272
fi
273-
- name: Prepare git-for-windows/git clone with the tag
273+
- name: Prepare ${{ env.OWNER }}/git clone with the tag
274274
if: steps.restore-cached-git-pkg.outputs.cache-hit != 'true'
275275
run: |
276276
set -x
277277
if test ! -d /usr/src/MINGW-packages
278278
then
279279
git clone --depth 1 --single-branch -b "$RELEASE_BRANCH" \
280-
https://github.com/git-for-windows/MINGW-packages /usr/src/MINGW-packages
280+
https://github.com/$OWNER/MINGW-packages /usr/src/MINGW-packages
281281
fi &&
282282
cd /usr/src/MINGW-packages/mingw-w64-git &&
283283
if test ! -d git
284284
then
285+
# Must be a clone of git-for-windows/git.git, otherwise `makepkg-mingw` will complain
285286
git clone --bare https://github.com/git-for-windows/git.git git
286287
fi &&
287288
if test ! -d src/git
288289
then
289-
git clone --reference git https://github.com/git-for-windows/git src/git &&
290+
git clone --reference git https://github.com/$OWNER/$REPO src/git &&
290291
echo ../../../../git/objects >src/git/.git/objects/info/alternates
291292
fi &&
292293
cd src/git &&
@@ -446,7 +447,7 @@ jobs:
446447
run: |
447448
git -c checkout.workers=56 \
448449
clone --single-branch -b "$RELEASE_BRANCH" --depth 1 \
449-
https://github.com/git-for-windows/git-sdk-$SDK_REPO_ARCH D:/git-sdk-$SDK_REPO_ARCH &&
450+
https://github.com/$OWNER/git-sdk-$SDK_REPO_ARCH D:/git-sdk-$SDK_REPO_ARCH &&
450451
451452
cygpath -aw D:/git-sdk-$SDK_REPO_ARCH/usr/bin/core_perl >>$GITHUB_PATH &&
452453
cygpath -aw D:/git-sdk-$SDK_REPO_ARCH/usr/bin >>$GITHUB_PATH &&
@@ -464,9 +465,9 @@ jobs:
464465
d=/usr/src/build-extra &&
465466
if test ! -d $d/.git
466467
then
467-
git clone --single-branch -b "$RELEASE_BRANCH" https://github.com/git-for-windows/build-extra $d
468+
git clone --single-branch -b "$RELEASE_BRANCH" https://github.com/$OWNER/build-extra $d
468469
else
469-
git -C $d fetch https://github.com/git-for-windows/build-extra "$RELEASE_BRANCH" &&
470+
git -C $d fetch https://github.com/$OWNER/build-extra "$RELEASE_BRANCH" &&
470471
git -C $d switch -C "$RELEASE_BRANCH" FETCH_HEAD
471472
fi &&
472473
echo "result=$(cygpath -am "$d")" >> $GITHUB_OUTPUT &&

0 commit comments

Comments
 (0)