Skip to content

Commit af40bb5

Browse files
committed
CI split-code.sh – try a different way of providing credentials
1 parent ba5aa06 commit af40bb5

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/release-composer-packages.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,15 @@ jobs:
5858
jq --version || (sudo apt-get update && sudo apt-get install -y jq)
5959
fi
6060
61+
- name: Install git-filter-repo
62+
run: |
63+
python3 -m pip install --user git-filter-repo
64+
echo "$HOME/.local/bin" >> $GITHUB_PATH
65+
6166
- name: Split code into component repositories
6267
env:
6368
GH_TOKEN: ${{ secrets.GH_TOKEN }}
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6470
PACKAGIST_USERNAME: ${{ secrets.PACKAGIST_USERNAME }}
6571
PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }}
6672
GH_CODESPLIT_EMAIL: ${{ secrets.GH_CODESPLIT_EMAIL }}

bin/split-code.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ split_and_push() {
5555
# Prefer GH_TOKEN; fall back to GITHUB_TOKEN for GitHub Actions
5656
token="${GH_TOKEN:-${GITHUB_TOKEN:-}}"
5757

58-
repo_url="https://x-access-token:${token}@github.com/${org}/${repo_name}.git"
58+
if [[ -n "$token" ]]; then
59+
git config --global url."https://x-access-token:${token}@github.com/".insteadOf "https://github.com/" || true
60+
repo_url="https://github.com/${org}/${repo_name}.git"
61+
else
62+
repo_url="[email protected]:${org}/${repo_name}.git"
63+
fi
5964

6065
echo "==> Splitting ${pkg_dir} -> ${org}/${repo_name}"
6166

0 commit comments

Comments
 (0)