Skip to content

Commit c347133

Browse files
committed
git-artifacts: allow specifying repo/ref via repository_dispatch
With this change, users can specify the branch and repository from which they want to build Git for Windows' artifacts. For example, this invocation will build a portable Git from current core Git's `pu` branch: curl -i -H 'Authorization: token <PAT>' \ -H 'Accept: application/vnd.github.everest-preview+json' \ --request POST \ --data '{ "event_type": "git-artifacts", "client_payload": { "build_only": "portable-x86_64", "repository": "git/git", "ref": "refs/heads/pu" } }' https://api.github.com/repos/<user>/git/dispatches Signed-off-by: Johannes Schindelin <[email protected]>
1 parent a6ccdd0 commit c347133

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/git-artifacts.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ env:
1313
PACKAGER: ${{github.actor}} <${{github.actor}}@users.noreply.github.com>
1414
USERPROFILE: "${{github.workspace}}\\home"
1515
BUILD_ONLY: "${{github.event.client_payload.build_only}}"
16+
REPOSITORY: "${{github.event.client_payload.repository}}"
17+
REF: "${{github.event.client_payload.ref}}"
1618

1719
jobs:
1820
bundle-artifacts:
@@ -45,9 +47,11 @@ jobs:
4547
printf '#!/bin/sh\n\nexec /mingw64/bin/git.exe "`$@"\n' >/usr/bin/git &&
4648
mkdir -p bundle-artifacts &&
4749
50+
{ test -n \"`$REPOSITORY\" || REPOSITORY='${{github.repository}}'; } &&
51+
{ test -n \"`$REF\" || REF='${{github.ref}}'; } &&
4852
git init --bare &&
4953
git remote add -f origin https://github.com/git-for-windows/git &&
50-
git fetch https://github.com/${{github.repository}} ${{github.ref}}:${{github.ref}} &&
54+
git fetch \"https://github.com/`$REPOSITORY\" \"`$REF:`$REF\" &&
5155
5256
tag_name=\"`$(git describe --match 'v[0-9]*' FETCH_HEAD)-`$(date +%Y%m%d%H%M%S)\" &&
5357
echo \"prerelease-`${tag_name#v}\" >bundle-artifacts/ver &&

0 commit comments

Comments
 (0)