Skip to content

Sonar

Sonar #620

Workflow file for this run

name: Sonar
on:
workflow_run:
workflows: ["Continuous Integration"]
types:
- completed
jobs:
sonar:
name: Sonar
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: 0
- name: "Get PR information"
uses: potiuk/get-workflow-origin@v1
id: source-run-info
with:
token: ${{ secrets.GITHUB_TOKEN }}
sourceRunId: ${{ github.event.workflow_run.id }}
- name: Upload Sonar report to sonarcloud.io and comment in pull request
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=adobeinc
-Dsonar.projectKey=adobe_aem-spa-page-model-manager
-Dsonar.sources=src
-Dsonar.tests=test
-Dsonar.javascript.lcov.reportPaths=dist/coverage/lcov.info
-Dsonar.pullrequest.key=${{ steps.source-run-info.outputs.pullRequestNumber }}
-Dsonar.pullrequest.branch=${{ steps.source-run-info.outputs.sourceHeadBranch }}
-Dsonar.pullrequest.base=${{ steps.source-run-info.outputs.targetBranch }}