diff --git a/.gitea/workflows/pull_request.yaml b/.gitea/workflows/pull_request.yaml index 7dd0672..9f3fb80 100644 --- a/.gitea/workflows/pull_request.yaml +++ b/.gitea/workflows/pull_request.yaml @@ -114,6 +114,26 @@ jobs: update-version: runs-on: ubuntu-latest steps: + - name: Test Token + run: | + echo "Testing token permissions..." + + # Token-Format prüfen + if [ -z "${{ secrets.BOT_TOKEN }}" ]; then + echo "❌ BOT_TOKEN ist nicht gesetzt" + exit 1 + fi + + # API-Call zum Prüfen der Token-Berechtigungen + curl -f -H "Authorization: token ${{ secrets.BOT_TOKEN }}" \ + https://git.yannick-weigert.de/api/v1/user + + # Repository-Zugriff testen + curl -f -H "Authorization: token ${{ secrets.BOT_TOKEN }}" \ + https://git.yannick-weigert.de/api/v1/repos/liquid-development/game-tracker + + echo "✅ Token ist gültig" + - name: Checkout code uses: actions/checkout@v4 with: @@ -137,23 +157,3 @@ jobs: # git push git push https://oauth2:${{ secrets.BOT_TOKEN }}@git.yannick-weigert.de/liquid-development/game-tracker.git HEAD:${{ gitea.head_ref }} - - name: Test Token - run: | - echo "Testing token permissions..." - - # Token-Format prüfen - if [ -z "${{ secrets.BOT_TOKEN }}" ]; then - echo "❌ BOT_TOKEN ist nicht gesetzt" - exit 1 - fi - - # API-Call zum Prüfen der Token-Berechtigungen - curl -f -H "Authorization: token ${{ secrets.BOT_TOKEN }}" \ - https://git.yannick-weigert.de/api/v1/user - - # Repository-Zugriff testen - curl -f -H "Authorization: token ${{ secrets.BOT_TOKEN }}" \ - https://git.yannick-weigert.de/api/v1/repos/liquid-development/game-tracker - - echo "✅ Token ist gültig" -