Skip to content

Commit

Permalink
fix: update sonarqube workflow to reduce runner minutes (#160)
Browse files Browse the repository at this point in the history
Co-authored-by: Edwin Sany <[email protected]>
  • Loading branch information
mike-ionut-mihai-sandu-tao and Edwin Sany authored Apr 17, 2024
1 parent 50b9da7 commit 45738a0
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
name: Sonarqube_CI
on:

pull_request:
types:
- labeled

push:
branches:
- master
- main
- develop

pull_request:
types: [opened, synchronize, reopened]
branches:
- '**'
workflow_dispatch:
- release-*

jobs:
build:
name: Sonarqube_CI
if: ${{ github.event.label.name == 'sonar_check' || github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -26,16 +25,16 @@ jobs:
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_HOST_URL: 'https://sonarqube.taotesting.info/sonarqube/'

# Job will fail when the Quality Gate is red
- name: Sonarqube quality gate check
id: sonarqube-quality-gate-check
id: sonarqube-quality-gate-check
uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}


- name: "Example show SonarQube Quality Gate Status value"
run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}"
run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}"

0 comments on commit 45738a0

Please sign in to comment.