Skip to content

Commit 628270a

Browse files
committed
[skip ci] chore: workflow to test sonar token
This is a test workflow to validate the sonar token. PR will be closed after the test is complete Signed-off-by: Vanessa Valderrama <[email protected]>
1 parent 72b89e6 commit 628270a

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed
Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,35 @@
11
name: Sonar Token Check
22
on:
33
workflow_dispatch:
4+
pull_request:
5+
branches:
6+
- chore/sonar-token-check
47

58
jobs:
69
check:
710
runs-on: ubuntu-latest
811
steps:
9-
- name: Show token owner
12+
- name: Show token owner (login only)
1013
env:
1114
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1215
run: |
13-
sudo apt-get update -y && sudo apt-get install -y jq
1416
curl -fsS -u "${SONAR_TOKEN}:" https://sonarcloud.io/api/users/current \
15-
| jq -r '.login,.name,.organizations'
17+
| jq -r '.login'
18+
19+
- name: Check org visibility
20+
env:
21+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
22+
ORG: academysoftwarefoundation
23+
run: |
24+
curl -fsS -u "${SONAR_TOKEN}:" \
25+
"https://sonarcloud.io/api/organizations/search?query=${ORG}" \
26+
| jq -r '.organizations[].key'
27+
28+
- name: Check project access
29+
env:
30+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
31+
PROJECT_KEY: AcademySoftwareFoundation_OpenImageIO
32+
run: |
33+
curl -fsS -u "${SONAR_TOKEN}:" \
34+
"https://sonarcloud.io/api/projects/search?projects=${PROJECT_KEY}" \
35+
| jq -r '.components[].key'

0 commit comments

Comments
 (0)