Skip to content

Commit aee2543

Browse files
committed
Refactor: Set the Sonar org and project keys as variables
1 parent 07a6339 commit aee2543

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/stage-2-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ jobs:
8686
- name: "Perform static analysis"
8787
uses: ./.github/actions/perform-static-analysis
8888
with:
89-
sonar_organisation_key: "${{ secrets.SONAR_ORGANISATION_KEY }}"
90-
sonar_project_key: "${{ secrets.SONAR_PROJECT_KEY }}"
89+
sonar_organisation_key: "${{ vars.SONAR_ORGANISATION_KEY }}"
90+
sonar_project_key: "${{ vars.SONAR_PROJECT_KEY }}"
9191
sonar_token: "${{ secrets.SONAR_TOKEN }}"

docs/user-guides/Perform_static_analysis.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Static code analysis is an essential part of modern software development. It pro
2727
- `sonar.[language].[coverage-tool].reportPaths` to ensure the unit test coverage is reported back to Sonar
2828
- Do not set the `sonar.organization` and `sonar.projectKey` properties in this file; do the next step instead
2929
- Follow the documentation on [creating encrypted secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) to add the `SONAR_TOKEN` secret to your repository. The GitHub action is already configured to fetch that secret and pass it as a variable. In addition to that:
30-
- Add `SONAR_ORGANISATION_KEY` secret
31-
- Add `SONAR_PROJECT_KEY` secret
30+
- Add `SONAR_ORGANISATION_KEY` variable (not a secret)
31+
- Add `SONAR_PROJECT_KEY` variable (not a secret)
3232
- Navigate to project `Administration > Analysis Method` and turn off the `Automatic Analysis` option
3333
- Please, refrain from adding your repository to the GitHub SonarCloud App. Doing so will duplicate reports and initiate them outside the primary pipeline workflow
3434
- Confirm that the GitHub action is part of your GitHub CI/CD workflow and enforces the "Sonar Way" quality gates. You can find more information about this in the [NHSE Software Engineering Quality Framework](https://github.com/NHSDigital/software-engineering-quality-framework/blob/main/tools/sonarqube.md)

0 commit comments

Comments
 (0)