Test PAT Token #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test PAT Token | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| test-token: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Test token availability | |
| run: | | |
| if [ -n "${{ secrets.PAT_TOKEN }}" ]; then | |
| echo "✅ PAT_TOKEN is available" | |
| echo "Token length: ${#PAT_TOKEN}" | |
| else | |
| echo "❌ PAT_TOKEN is not set" | |
| exit 1 | |
| fi | |
| env: | |
| PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | |
| - name: Test GitHub API access | |
| run: | | |
| echo "🔍 Testing GitHub API access..." | |
| response=$(curl -s -H "Authorization: token $PAT_TOKEN" https://api.github.com/user) | |
| if echo "$response" | jq -e '.login' > /dev/null; then | |
| echo "✅ API access works" | |
| echo "User: $(echo "$response" | jq -r '.login')" | |
| else | |
| echo "❌ API access failed" | |
| echo "Response: $response" | |
| exit 1 | |
| fi | |
| env: | |
| PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | |
| - name: Test repository access | |
| run: | | |
| echo "🔍 Testing access to infotecha repository..." | |
| response=$(curl -s -H "Authorization: token $PAT_TOKEN" https://api.github.com/repos/info-tech-io/infotecha) | |
| if echo "$response" | jq -e '.full_name' > /dev/null; then | |
| echo "✅ Repository access works" | |
| echo "Repository: $(echo "$response" | jq -r '.full_name')" | |
| else | |
| echo "❌ Repository access failed" | |
| echo "Response: $response" | |
| exit 1 | |
| fi | |
| env: | |
| PAT_TOKEN: ${{ secrets.PAT_TOKEN }} |