From a553fd0ec378bdcf24ea4456f4dc1905258f4c5f Mon Sep 17 00:00:00 2001 From: Dan Calavrezo Date: Wed, 17 Sep 2025 15:06:16 +0300 Subject: [PATCH 1/2] Create test.yaml Signed-off-by: Dan Calavrezo --- .github/workflows/test.yaml | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..1ae9a4f --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,39 @@ +name: Test Org Tokens + +on: + workflow_dispatch: + +jobs: + test-tokens: + runs-on: ubuntu-latest + strategy: + matrix: + token_name: + - RENOVATE_TOKEN + - GH_PUBLISH_TOKEN + - SCORE_BOT_PAT + steps: + - name: Test token ${{ matrix.token_name }} + env: + TOKEN: ${{ secrets[matrix.token_name] }} + TOKEN_NAME: ${{ matrix.token_name }} + run: | + echo "🔎 Testing token: $TOKEN_NAME" + + echo "==> /user" + curl -s -H "Authorization: token $TOKEN" https://api.github.com/user | jq '{login, id}' + + echo "==> Token scopes" + curl -sI -H "Authorization: token $TOKEN" https://api.github.com/user | grep x-oauth-scopes || true + + echo "==> Try PR reviews API" + STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ + -H "Authorization: token $TOKEN" \ + https://api.github.com/repos/qorix-group/sccache_server_image/pulls/1/reviews) + echo "PR Reviews: $STATUS" + + echo "==> Try team members API" + STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ + -H "Authorization: token $TOKEN" \ + https://api.github.com/orgs/qorix-group/teams/qorix-reviewers/members) + echo "Team Members: $STATUS" From 108055e76ddb3a181fc1d3a27adeca074e0c9d9a Mon Sep 17 00:00:00 2001 From: Dan Calavrezo Date: Wed, 17 Sep 2025 15:08:17 +0300 Subject: [PATCH 2/2] Update test.yaml Signed-off-by: Dan Calavrezo --- .github/workflows/test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1ae9a4f..d515517 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,6 +2,8 @@ name: Test Org Tokens on: workflow_dispatch: + pull_request: # also run on PRs + types: [opened, reopened, synchronize, ready_for_review] jobs: test-tokens: