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