Skip to content

Commit

Permalink
Try to trigger workflow after Jenkins job completes
Browse files Browse the repository at this point in the history
  • Loading branch information
amvanbaren committed Nov 16, 2023
1 parent bd4972c commit 5ac5cb0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/main.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Sonar
on:
workflow_run:
workflows: [continuous-integration/jenkins/pr-head]
types: [completed]
jobs:
sonar:
name: Sonar
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }}
-Dsonar.pullrequest.key=${{ github.event.workflow_run.pull_requests[0].number }}
-Dsonar.pullrequest.branch=${{ github.event.workflow_run.pull_requests[0].head.ref }}
-Dsonar.pullrequest.base=${{ github.event.workflow_run.pull_requests[0].base.ref }}

0 comments on commit 5ac5cb0

Please sign in to comment.