Skip to content

Commit e88d911

Browse files
committed
update token test
1 parent 5300e23 commit e88d911

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed

β€Ž.github/workflows/token_test.yamlβ€Ž

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,38 @@ jobs:
1313
exit 1
1414
else
1515
echo "βœ… AUTO_MERGE_TOKEN is accessible"
16-
# Test basic API access
17-
curl -s -H "Authorization: token ${{ secrets.AUTO_MERGE_TOKEN }}" \
18-
https://api.github.com/user | jq -r .login || echo "Token validation failed"
19-
fi
16+
fi
17+
18+
- name: Test with GitHub CLI
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.AUTO_MERGE_TOKEN }}
21+
run: |
22+
echo "πŸ” Testing authentication..."
23+
24+
# Get authenticated user
25+
if USER=$(gh api user --jq .login 2>&1); then
26+
echo "βœ… Authenticated as: $USER"
27+
else
28+
echo "❌ Authentication failed: $USER"
29+
exit 1
30+
fi
31+
32+
# Test repository access
33+
echo "πŸ“‹ Testing repository access..."
34+
if REPO=$(gh api repos/${{ github.repository }} --jq .full_name 2>&1); then
35+
echo "βœ… Can access repository: $REPO"
36+
else
37+
echo "❌ Cannot access repository: $REPO"
38+
exit 1
39+
fi
40+
41+
# Test PR operations
42+
echo "πŸ” Testing PR access..."
43+
if PRS=$(gh pr list --repo ${{ github.repository }} --limit 1 2>&1); then
44+
echo "βœ… Can access pull requests"
45+
else
46+
echo "❌ Cannot access PRs: $PRS"
47+
exit 1
48+
fi
49+
50+
echo "πŸŽ‰ All tests passed!"

0 commit comments

Comments
Β (0)