Skip to content

Commit

Permalink
chr: use SONAR_PROJECT_KEY and SONAR_ORGANIZATION env vars in build
Browse files Browse the repository at this point in the history
The new repos will have these vars set. For now the build falls back to the
previous values, if the variables are not set.
  • Loading branch information
dblankevia committed Feb 1, 2023
1 parent cee5de5 commit 1a49cdc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,19 @@ jobs:
cmd: install # will run `yarn install` command
- name: Run npm test:ci
run: CHROMIUM_BIN=$(which chrome) npm run test:ci # will run `test:ci` command
- uses: SonarSource/sonarcloud-github-action@master
- name: Run SonarCloud with organzation and project key from environment
uses: SonarSource/sonarcloud-github-action@master
if: ${{ env.SONAR_ORGANIZATION != '' && env.SONAR_PROJECT_KEY != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=${{ env.SONAR_ORGANIZATION }}
-Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }}
- name: Run SonarCloud with hardcoded organization and project key
uses: SonarSource/sonarcloud-github-action@master # Fallback for the catenax-ng/product-traceability-foss-frontend
if: ${{ env.SONAR_ORGANIZATION == '' || env.SONAR_PROJECT_KEY == '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 comments on commit 1a49cdc

Please sign in to comment.