Skip to content

Commit a553fd0

Browse files
Create test.yaml
Signed-off-by: Dan Calavrezo <[email protected]>
1 parent 1552d9d commit a553fd0

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/test.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test Org Tokens
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
test-tokens:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
token_name:
12+
- RENOVATE_TOKEN
13+
- GH_PUBLISH_TOKEN
14+
- SCORE_BOT_PAT
15+
steps:
16+
- name: Test token ${{ matrix.token_name }}
17+
env:
18+
TOKEN: ${{ secrets[matrix.token_name] }}
19+
TOKEN_NAME: ${{ matrix.token_name }}
20+
run: |
21+
echo "🔎 Testing token: $TOKEN_NAME"
22+
23+
echo "==> /user"
24+
curl -s -H "Authorization: token $TOKEN" https://api.github.com/user | jq '{login, id}'
25+
26+
echo "==> Token scopes"
27+
curl -sI -H "Authorization: token $TOKEN" https://api.github.com/user | grep x-oauth-scopes || true
28+
29+
echo "==> Try PR reviews API"
30+
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
31+
-H "Authorization: token $TOKEN" \
32+
https://api.github.com/repos/qorix-group/sccache_server_image/pulls/1/reviews)
33+
echo "PR Reviews: $STATUS"
34+
35+
echo "==> Try team members API"
36+
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
37+
-H "Authorization: token $TOKEN" \
38+
https://api.github.com/orgs/qorix-group/teams/qorix-reviewers/members)
39+
echo "Team Members: $STATUS"

0 commit comments

Comments
 (0)