Skip to content

Commit

Permalink
chore(sage-monorepo): add support to run Sonar on Sage Monorepo branc…
Browse files Browse the repository at this point in the history
…hes (#2516)
  • Loading branch information
tschaffter authored Feb 21, 2024
1 parent 8958bed commit cc1d864
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
name: Scan affected projects with Sonar
on:
push:
branches:
- main
- 'agora/**'
- 'iatlas/**'
- 'openchallenges/**'
- 'sage-monorepo/**'
- 'schematic/**'
pull_request_target:
types: [opened, synchronize, reopened, labeled]

env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
HEAD_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
APPROVAL_NEEDED: ${{ github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'sonar-scan-approved') != true }}

jobs:
sonar:
runs-on: ubuntu-latest
steps:
- name: Check if the label `sonar-scan-approved` exists
if: contains(github.event.pull_request.labels.*.name, 'sonar-scan-approved') != true
if: ${{ env.APPROVAL_NEEDED }}
run: echo "Add the label 'sonar-scan-approved' to this PR to activate Sonar scan"; exit 1

- uses: actions/checkout@v3
Expand Down

0 comments on commit cc1d864

Please sign in to comment.