From 72b89e67e5221ea491078a4a6050f09e09ed97df Mon Sep 17 00:00:00 2001 From: Vanessa Valderrama Date: Thu, 25 Sep 2025 21:45:33 -0500 Subject: [PATCH 1/3] chore: workflow to check sonar token This patch is for a throw away workflow to check the sonar token The PR will be closed after the check is done Signed-off-by: Vanessa Valderrama --- .github/workflows/sonar-token-check.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/sonar-token-check.yml diff --git a/.github/workflows/sonar-token-check.yml b/.github/workflows/sonar-token-check.yml new file mode 100644 index 0000000000..2944b3c6e5 --- /dev/null +++ b/.github/workflows/sonar-token-check.yml @@ -0,0 +1,15 @@ +name: Sonar Token Check +on: + workflow_dispatch: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Show token owner + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + sudo apt-get update -y && sudo apt-get install -y jq + curl -fsS -u "${SONAR_TOKEN}:" https://sonarcloud.io/api/users/current \ + | jq -r '.login,.name,.organizations' From 628270aa9a05547dd1986c32ae6c3ea4ecc61a5c Mon Sep 17 00:00:00 2001 From: Vanessa Valderrama Date: Thu, 25 Sep 2025 21:47:19 -0500 Subject: [PATCH 2/3] [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 --- .github/workflows/sonar-token-check.yml | 26 ++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sonar-token-check.yml b/.github/workflows/sonar-token-check.yml index 2944b3c6e5..96c7964e6e 100644 --- a/.github/workflows/sonar-token-check.yml +++ b/.github/workflows/sonar-token-check.yml @@ -1,15 +1,35 @@ name: Sonar Token Check on: workflow_dispatch: + pull_request: + branches: + - chore/sonar-token-check jobs: check: runs-on: ubuntu-latest steps: - - name: Show token owner + - name: Show token owner (login only) env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | - sudo apt-get update -y && sudo apt-get install -y jq curl -fsS -u "${SONAR_TOKEN}:" https://sonarcloud.io/api/users/current \ - | jq -r '.login,.name,.organizations' + | jq -r '.login' + + - name: Check org visibility + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + ORG: academysoftwarefoundation + run: | + curl -fsS -u "${SONAR_TOKEN}:" \ + "https://sonarcloud.io/api/organizations/search?query=${ORG}" \ + | jq -r '.organizations[].key' + + - name: Check project access + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + PROJECT_KEY: AcademySoftwareFoundation_OpenImageIO + run: | + curl -fsS -u "${SONAR_TOKEN}:" \ + "https://sonarcloud.io/api/projects/search?projects=${PROJECT_KEY}" \ + | jq -r '.components[].key' From 94ec8801d9302e06b2e30562a0319b3da4ce0149 Mon Sep 17 00:00:00 2001 From: Vanessa Valderrama Date: Thu, 25 Sep 2025 22:56:47 -0500 Subject: [PATCH 3/3] [skip ci] chore: trigger workflow registration