更新 .gitea/workflows/build-image.yml
This commit is contained in:
@@ -23,15 +23,16 @@ jobs:
|
|||||||
runs-on: self_website
|
runs-on: self_website
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check Secret availability
|
- name: Test token with wget
|
||||||
run: |
|
run: |
|
||||||
echo "Checking if TOKEN secret exists..."
|
echo "Testing token authentication..."
|
||||||
if [ -n "${{ secrets.TOKEN }}" ]; then
|
wget -q --header="Authorization: token ${{ secrets.TOKEN }}" \
|
||||||
echo "TOKEN secret is available"
|
--spider https://git.crash.work/api/v1/user || echo "wget test failed"
|
||||||
# 测试token有效性
|
|
||||||
curl -f -H "Authorization: token ${{ secrets.TOKEN }}" \
|
- name: Test git access
|
||||||
https://git.crash.work/api/v1/user/repos | head -5
|
run: |
|
||||||
else
|
echo "Testing git clone with token..."
|
||||||
echo "TOKEN secret is NOT available"
|
git clone https://${{ secrets.TOKEN }}@git.crash.work/herryyun/checkout.git /tmp/test-checkout
|
||||||
fi
|
ls -la /tmp/test-checkout
|
||||||
|
env:
|
||||||
|
GIT_TERMINAL_PROMPT: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user