Skip to content

Commit c63dff2

Browse files
committed
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 c63dff2

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

.github/workflows/sonar-token-check.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,27 @@ jobs:
66
check:
77
runs-on: ubuntu-latest
88
steps:
9-
- name: Show token owner
9+
- name: Show token owner (login only)
1010
env:
1111
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1212
run: |
13-
sudo apt-get update -y && sudo apt-get install -y jq
1413
curl -fsS -u "${SONAR_TOKEN}:" https://sonarcloud.io/api/users/current \
15-
| jq -r '.login,.name,.organizations'
14+
| jq -r '.login'
15+
16+
- name: Check org visibility
17+
env:
18+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
19+
ORG: academysoftwarefoundation
20+
run: |
21+
curl -fsS -u "${SONAR_TOKEN}:" \
22+
"https://sonarcloud.io/api/organizations/search?query=${ORG}" \
23+
| jq -r '.organizations[].key'
24+
25+
- name: Check project access
26+
env:
27+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
28+
PROJECT_KEY: AcademySoftwareFoundation_OpenImageIO
29+
run: |
30+
curl -fsS -u "${SONAR_TOKEN}:" \
31+
"https://sonarcloud.io/api/projects/search?projects=${PROJECT_KEY}" \
32+
| jq -r '.components[].key'

0 commit comments

Comments
 (0)