Skip to content

Commit

Permalink
ci: run scan on both main and target branch
Browse files Browse the repository at this point in the history
  • Loading branch information
phwt committed Sep 12, 2023
1 parent 671960f commit 7fe1bab
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,38 @@ jobs:
- run: |
echo "${{ steps.quality-gate-check.outputs.project-status }}"
echo "${{ steps.quality-gate-check.outputs.quality-gate-result }}"
sonar-scan-main:
name: SonarCloud (Main)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=phwt
-Dsonar.projectKey=sonarqube-quality-gate-action
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
- name: Wait quality gate result
run: sleep 5

- name: Create a comment with the result
uses: ./
id: quality-gate-check
with:
sonar-host-url: ${{ env.SONAR_HOST_URL }}
sonar-project-key: ${{ env.SONAR_PROJECT_KEY }}
sonar-token: ${{ secrets.SONAR_TOKEN }}
disable-pr-comment: true

- run: |
echo "${{ steps.quality-gate-check.outputs.project-status }}"
echo "${{ steps.quality-gate-check.outputs.quality-gate-result }}"

0 comments on commit 7fe1bab

Please sign in to comment.