-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6508e6d
commit 0821d6c
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Scan affected projects with Sonar NEW | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'agora/**' | ||
- 'iatlas/**' | ||
- 'openchallenges/**' | ||
- 'sage-monorepo/**' | ||
- 'schematic/**' | ||
pull_request_target: | ||
types: [opened, synchronize, reopened, labeled] | ||
|
||
env: | ||
HEAD_REF: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.ref || github.ref_name }} | ||
HEAD_REPOSITORY: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name || github.repository }} | ||
|
||
jobs: | ||
sonar: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if the label `sonar-scan-approved` exists | ||
if: ${{ github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'sonar-scan-approved') != true }} | ||
run: echo "Add the label 'sonar-scan-approved' to this PR to activate Sonar scan"; exit 1 | ||
|
||
- name: Checkout | ||
uses: ./.github/actions/checkout | ||
|
||
- name: Derive appropriate SHAs for base and head for `nx affected` commands | ||
uses: nrwl/nx-set-shas@v4 | ||
|
||
# - name: Set up the dev container | ||
# env: | ||
# SONAR_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} | ||
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
# uses: ./.github/actions/setup-dev-container | ||
|
||
# - name: Scan the affected projects with Sonar | ||
# run: | | ||
# devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \ | ||
# && nx affected --target=sonar" |