Skip to content

Commit 582cfeb

Browse files
committed
PHP split: replace docker action with manual splitsh-lite + git push
The danharrin/monorepo-split-github-action builds a clone URL as https://<TOKEN>@github.com which works with classic PATs (token works as username) but FAILS with GitHub App installation tokens, which per GitHub docs must be used as https://x-access-token:<TOKEN>@github.com (token as password, 'x-access-token' as username). Symptom seen in the failed run after merging v0.0.2: fatal: could not read Password for 'https://***@github.com': No such device or address Replacing the action with splitsh-lite v2.0.0 + a manual git push lets us control the remote URL format. Bonus: splitsh-lite is the same underlying tool the docker action wraps, and it preserves the full git history of implementations/php/ as Packagist expects. Both release.yml (tagged release path) and php-split.yml (master-sync path) get the same treatment.
1 parent dd7ee05 commit 582cfeb

2 files changed

Lines changed: 33 additions & 19 deletions

File tree

.github/workflows/php-split.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,19 @@ jobs:
2424
private-key: ${{ secrets.SPLIT_APP_PRIVATE_KEY }}
2525
owner: kduma-OSS-splits
2626

27-
- uses: danharrin/monorepo-split-github-action@v2.3.0
28-
with:
29-
package_directory: 'implementations/php'
30-
repository_organization: 'kduma-OSS-splits'
31-
repository_name: 'PHP-PCF-lib'
32-
user_name: 'github-actions[bot]'
33-
user_email: '41898282+github-actions[bot]@users.noreply.github.com'
34-
branch: 'master'
27+
- name: Install splitsh-lite
28+
run: |
29+
set -euo pipefail
30+
curl -sSL https://github.com/splitsh/lite/releases/download/v2.0.0/lite_linux_amd64.tar.gz \
31+
| sudo tar -xz -C /usr/local/bin splitsh-lite
32+
splitsh-lite --version
33+
34+
- name: Split implementations/php and push to PHP-PCF-lib (master only)
3535
env:
36-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
36+
APP_TOKEN: ${{ steps.app-token.outputs.token }}
37+
run: |
38+
set -euo pipefail
39+
SHA=$(splitsh-lite --prefix=implementations/php --quiet | tail -n1)
40+
echo "Split SHA: $SHA"
41+
REMOTE="https://x-access-token:${APP_TOKEN}@github.com/kduma-OSS-splits/PHP-PCF-lib.git"
42+
git push --force "$REMOTE" "${SHA}:refs/heads/master"

.github/workflows/release.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,22 @@ jobs:
219219
private-key: ${{ secrets.SPLIT_APP_PRIVATE_KEY }}
220220
owner: kduma-OSS-splits
221221

222-
- uses: danharrin/monorepo-split-github-action@v2.3.0
223-
with:
224-
package_directory: 'implementations/php'
225-
repository_organization: 'kduma-OSS-splits'
226-
repository_name: 'PHP-PCF-lib'
227-
user_name: 'github-actions[bot]'
228-
user_email: '41898282+github-actions[bot]@users.noreply.github.com'
229-
branch: 'master'
230-
tag: 'v${{ needs.resolve.outputs.version }}'
222+
- name: Install splitsh-lite
223+
run: |
224+
set -euo pipefail
225+
curl -sSL https://github.com/splitsh/lite/releases/download/v2.0.0/lite_linux_amd64.tar.gz \
226+
| sudo tar -xz -C /usr/local/bin splitsh-lite
227+
splitsh-lite --version
228+
229+
- name: Split implementations/php and push to PHP-PCF-lib
231230
env:
232-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
231+
APP_TOKEN: ${{ steps.app-token.outputs.token }}
232+
VERSION: ${{ needs.resolve.outputs.version }}
233+
run: |
234+
set -euo pipefail
235+
SHA=$(splitsh-lite --prefix=implementations/php --quiet | tail -n1)
236+
echo "Split SHA: $SHA"
237+
REMOTE="https://x-access-token:${APP_TOKEN}@github.com/kduma-OSS-splits/PHP-PCF-lib.git"
238+
git push --force "$REMOTE" "${SHA}:refs/heads/master"
239+
git tag -f "v${VERSION}" "$SHA"
240+
git push --force "$REMOTE" "refs/tags/v${VERSION}"

0 commit comments

Comments
 (0)