Skip to content

Commit 0895044

Browse files
Set git credentials by git-config instead of depending on actions/checkout
Because swift repository is now checkout under ../build/Distribution by gh-distribute-toolchain and the path can be changed in the future, we shouldn't assume the path of swift repository. actions/checkout strategy to pass credentials to git depends on the path, so we manually set the credentials by ourselves. The `extraheader` strategy somehow doesn't work now, so we use basic authentication embedded in the url.
1 parent 00ae039 commit 0895044

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

.github/workflows/distribute-toolchain.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@ jobs:
2323
with:
2424
repository: swiftwasm/swiftwasm-build
2525
path: swiftwasm-build
26-
# Checkout swiftwasm/swift also to push tags
27-
- uses: actions/checkout@v3
28-
with:
29-
repository: swiftwasm/swift
30-
path: swift
31-
- run: git -C swift remote rename origin swiftwasm
32-
- run: git -C swift remote add upstream https://github.com/apple/swift.git
26+
- name: git config for pushing tags
27+
run: git config --global url."https://x-access-token:$GITHUB_TOKEN@github.com/swiftwasm/swift.git".insteadOf "git@github.com:swiftwasm/swift.git"
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3330
- name: Setup environment variables
3431
run: |
3532
if [[ -n "${{ github.event.inputs.display-name }}" ]]; then

0 commit comments

Comments
 (0)