-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement SonarCloud Analysis Workflow in GitHub Actions (#73)
* added sonarcloud workflow * changed token name
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Run SonarCloud Analysis | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "lib/**" | ||
- "index.js" | ||
- ".github/workflows/sonarcloud.yml" | ||
|
||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "lib/**" | ||
- "index.js" | ||
- ".github/workflows/sonarcloud.yml" | ||
|
||
permissions: | ||
pull-requests: read # allows SonarCloud to decorate PRs with analysis results | ||
|
||
jobs: | ||
SonarCloudAnalysis-Watcher: | ||
name: SonarCloud Analysis Watcher | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Important to fetch all history for accurate blame information | ||
- name: Analyze Watcher with SonarCloud | ||
uses: SonarSource/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_WATCHER }} # Needed to push to SonarCloud | ||
with: | ||
# Additional arguments for the sonarcloud scanner | ||
args: -Dsonar.projectKey=NUWCDIVNPT_stigman-watcher | ||
-Dsonar.projectName=NUWCDIVNPT_stigman-watcher | ||
-Dsonar.organization=nuwcdivnpt | ||
-Dsonar.inclusions=**/*.js | ||
-Dsonar.exclusions=**/node_modules/**, | ||
|
||
|
||
# This will fail the action if Quality Gate fails (leaving out for now ) | ||
# - name: Check Quality Gate | ||
# uses: sonarsource/sonarqube-quality-gate-action@master | ||
# env: | ||
# SONAR_TOKEN: |