Skip to content

Commit 979e871

Browse files
committed
fix: add GOPLUS_TOKEN validation for Git configuration in validate workflow
1 parent 6f1d02e commit 979e871

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/validate.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ jobs:
7878
env:
7979
GOPLUS_TOKEN: ${{ secrets.GOPLUS_TOKEN }}
8080
run: |
81+
if [ -z "$GOPLUS_TOKEN" ]; then
82+
echo "ERROR: GOPLUS_TOKEN is not set. Skipping git configuration."
83+
exit 1
84+
fi
8185
git config --global url."https://${GOPLUS_TOKEN}@github.com/".insteadOf "https://github.com/"
8286
git config --global url."https://${GOPLUS_TOKEN}@github.com/".insteadOf "[email protected]:"
8387
echo "Git configuration applied:"
@@ -98,9 +102,17 @@ jobs:
98102
go env GONOSUMDB
99103
100104
- name: Clear Go module cache and verify access
105+
env:
106+
GOPLUS_TOKEN: ${{ secrets.GOPLUS_TOKEN }}
101107
run: |
102108
go clean -modcache
103109
echo "Testing git access to private repo..."
110+
echo "Token length: ${#GOPLUS_TOKEN}"
111+
if [ -z "$GOPLUS_TOKEN" ]; then
112+
echo "ERROR: GOPLUS_TOKEN is empty!"
113+
else
114+
echo "Token is set (first 4 chars: ${GOPLUS_TOKEN:0:4}...)"
115+
fi
104116
git ls-remote https://github.com/goplus/sb2xbp.git || echo "Git access test failed"
105117
106118
- name: Run unit test cases

0 commit comments

Comments
 (0)