-
-
Notifications
You must be signed in to change notification settings - Fork 64
35 lines (32 loc) · 1.42 KB
/
qodana-scan-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Qodana for Pull Request
on:
pull_request:
branches:
- main
jobs:
qodana:
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
pull-requests: write
checks: write
security-events: write
steps:
# skip all the steps if the head repo is not the same as the main repo
# https://github.com/orgs/community/discussions/26829#discussioncomment-3253575
- uses: actions/[email protected]
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
with:
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
fetch-depth: 0 # a full history is required for pull request analysis
submodules: recursive # many many submodules
- name: 'Qodana Scan'
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
uses: JetBrains/qodana-action@latest
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} # read the steps about it below
- uses: github/codeql-action/upload-sarif@v3
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
with:
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json