Update readme file #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SonarQube Scan | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| sonarQubeScan: | |
| name: SonarQube Analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| run: npm install | |
| # GitHub Action to run SonarQube scan | |
| - name: Run SonarQube Scan | |
| uses: SonarSource/sonarqube-scan-action@v2.0.2 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| # use https://your-sonarqube-server.com if using SonarQube or else use https://sonarcloud.io for SonarCloud | |
| SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
| # GitHub Action to check Quality Gate status after scan | |
| - name: Quality Gate Check | |
| uses: SonarSource/sonarqube-quality-gate-action@v1.1.0 | |
| timeout-minutes: 5 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |