Skip to content

Commit e8b2871

Browse files
committed
Use TRUSTED_SHARED_SOURCE_GITHUB_TOKEN for cross-repo access in CI
Replace github.token with the org-scoped PAT so gh can clone trusted/docs and other private repos during setup.
1 parent 183ce35 commit e8b2871

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: bash setup.sh
2727
env:
2828
CI: "true"
29-
GH_TOKEN: ${{ github.token }}
29+
GH_TOKEN: ${{ secrets.TRUSTED_SHARED_SOURCE_GITHUB_TOKEN }}
3030

3131
- name: Install bats
3232
run: sudo apt-get install -y -qq bats
@@ -36,3 +36,5 @@ jobs:
3636
export PATH="$HOME/.local/bin:$PATH"
3737
eval "$(mise activate bash)"
3838
bats test/setup_test.bats
39+
env:
40+
GH_TOKEN: ${{ secrets.TRUSTED_SHARED_SOURCE_GITHUB_TOKEN }}

setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ clone_to_work() {
430430
fmt_ok "$name already at $dir"
431431
elif gh auth status > /dev/null 2>&1; then
432432
fmt_install "Cloning $name to $dir"
433-
gh repo clone "$repo" "$dir" -- --quiet
433+
gh repo clone "$repo" "$dir" -- --quiet || echo " WARNING: Failed to clone $name. You may not have access."
434434
else
435435
echo " Skipping $name clone (gh not authenticated)."
436436
fi

0 commit comments

Comments
 (0)