Conversation
| name: SonarCloud | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
| - name: SonarCloud Scan | ||
| uses: SonarSource/sonarqube-scan-action@v4 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} No newline at end of file |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 months ago
To fix the problem, add an explicit permissions block specifying the minimum permissions necessary for the workflow to operate correctly. For a SonarCloud scan job, this generally means granting read access to contents and write access to pull requests (so that analysis results can be published as comments, if configured). Place the permissions block at the top-level of the workflow file to apply to all jobs, or within the specific sonarcloud job for a targeted approach. For simplicity and clarity, set it at the root of .github/workflows/build.yml (above jobs:), as it applies to all jobs unless overridden.
You only need to edit .github/workflows/build.yml: insert the following block after the workflow name::
permissions:
contents: read
pull-requests: writeThis grants contents read access and pull request write access—which aligns with least privilege and the requirements for SonarCloud and GitHub PR integration.
| @@ -1,3 +1,6 @@ | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| name: Build | ||
| on: | ||
| push: |
…ge to main as well as manual deployment against other environments
Report for environment: pre-prodTerraform Format and Style 🖌``Format OutputTerraform Initialization ⚙️
|
Report for environment: testTerraform Format and Style 🖌``Format OutputTerraform Initialization ⚙️
|
Report for environment: prodTerraform Format and Style 🖌``Format OutputTerraform Initialization ⚙️
|
Report for environment: devTerraform Format and Style 🖌``Format OutputTerraform Initialization ⚙️
|
No description provided.