Merge pull request #95 from nsftx/dependabot/npm_and_yarn/ws-8.18.0 #214
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
name: NSoft SonarQube Analysis | |
on: | |
push: | |
branches: | |
- master | |
- next | |
pull_request: | |
jobs: | |
sq_scan_job: | |
runs-on: ubuntu-latest | |
name: SonarQube scan | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup sonarqube | |
uses: warchant/setup-sonar-scanner@v3 | |
- name: Run sonarqube | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
shell: bash | |
run: | |
if [ "$GITHUB_EVENT_NAME" = "push" ]; then | |
echo "$GITHUB_EVENT_NAME" && | |
sonar-scanner | |
-Dsonar.login=${{ secrets.SONAR_TOKEN }} | |
-Dsonar.branch.name=${GITHUB_REF#refs/heads/}; | |
elif [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then | |
echo "$GITHUB_EVENT_NAME" && | |
sonar-scanner | |
-Dsonar.login=${{ secrets.SONAR_TOKEN }} | |
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} | |
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} | |
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }} | |
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}; | |
fi |