Skip to content

SonarCloud Scan

SonarCloud Scan #6

Workflow file for this run

name: SonarCloud Scan
on:
workflow_run:
workflows: [Test]
types: [completed]
jobs:
sonarcloud:
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
- uses: dawidd6/[email protected]
with:
workflow: tests.yml
commit: ${{ github.event.workflow_run.head_sha }}
- name: Override Coverage Source Path for Sonar
run: sed -i 's/\/home\/runner\/work\/NTHU-Data-API\/NTHU-Data-API\//\/github\/workspace\//g' coverage/coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}