Skip to content

Commit

Permalink
Merge pull request #192 from daithihearn/sonar-auto
Browse files Browse the repository at this point in the history
test: switching to automatic sonar analysis
  • Loading branch information
daithihearn authored Oct 3, 2023
2 parents 91c5de7 + 5b2e299 commit 18d9327
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,19 @@ jobs:
run: yarn install --frozen-lockfile
- name: Test and coverage
run: yarn jest --coverage
- name: Sonar Args
id: sonar-args
run: |
if [[ ${{ github.ref }} == 'refs/heads/main' ]]; then
echo "SONAR_ARGS=-Dsonar.branch.name=main" >> $GITHUB_OUTPUT
else
echo "SONAR_ARGS=-Dsonar.branch.target=main -Dsonar.branch.name=${{ github.head_ref }}" >> $GITHUB_OUTPUT
fi
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: ${{ steps.sonar-args.outputs.SONAR_ARGS }}

0 comments on commit 18d9327

Please sign in to comment.