Skip to content

Commit 258ceff

Browse files
committed
add debug steps to verify GH_TOKEN access and git authentication
1 parent 58e9c03 commit 258ceff

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/build-citus-community-nightlies.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,49 @@ jobs:
6060
username: ${{ secrets.DOCKERHUB_USER_NAME }}
6161
password: ${{ secrets.DOCKERHUB_PASSWORD }}
6262

63+
- name: "Debug: Confirm token can access repos and git auth works"
64+
run: |
65+
echo "GH_TOKEN present: ${GH_TOKEN:+yes}"
66+
echo "GH_TOKEN length: $(echo -n "$GH_TOKEN" | wc -c)"
67+
68+
packaging_status=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token $GH_TOKEN" https://api.github.com/repos/citusdata/packaging)
69+
echo "packaging repo status: $packaging_status"
70+
docker_status=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: token $GH_TOKEN" https://api.github.com/repos/citusdata/docker)
71+
echo "docker repo status: $docker_status"
72+
73+
if [[ "$packaging_status" != "200" ]]; then
74+
echo "ERROR: packaging repo access failed with status $packaging_status"
75+
exit 1
76+
fi
77+
if [[ "$docker_status" != "200" ]]; then
78+
echo "ERROR: docker repo access failed with status $docker_status"
79+
exit 1
80+
fi
81+
82+
if git ls-remote --exit-code "https://github.com/citusdata/packaging.git" HEAD >/dev/null 2>&1; then
83+
echo "git auth (ls-remote) succeeded"
84+
else
85+
echo "git auth (ls-remote) FAILED"
86+
exit 1
87+
fi
88+
89+
- name: "Debug: Verify git config url rewrite is active"
90+
run: git config --global --get-regexp url.*insteadOf | sed -E 's@(https://x-access-token:)[^@]*@\1REDACTED@' || true
91+
92+
- name: "Debug: Test token access from inside container"
93+
run: |
94+
docker run --rm -e GITHUB_TOKEN="$GH_TOKEN" citus/packaging-test:debian-trixie-all sh -c "curl -s -o /dev/null -w 'Container API status: %{http_code}\n' -H 'Authorization: token \$GITHUB_TOKEN' https://api.github.com/repos/citusdata/packaging"
95+
6396
- name: Clone build branch
6497
run: git clone -b "${MAIN_BRANCH}" --depth=1 https://github.com/citusdata/packaging.git packaging
6598

99+
- name: "Debug: Confirm clone succeeded and files are present"
100+
run: |
101+
echo "packaging dir listing:"
102+
ls -la packaging || true
103+
echo "templates docker listing:"
104+
find packaging -maxdepth 4 -type f -name '*docker*' -print || true
105+
66106
- name: Install package dependencies
67107
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources
68108

0 commit comments

Comments
 (0)