Skip to content

Sonar

Sonar #32

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_3
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify sonar:sonar -Dsonar.coverage.jacoco.xmlReportPaths=../core/target/site/jacoco/jacoco.xml -Dsonar.organization=adobeinc -Dsonar.projectKey=adobe_aem-spa-project-core -Dsonar.login=$SONAR_TOKEN -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 }}