-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (39 loc) · 1.22 KB
/
Copy pathpr-build.yml
File metadata and controls
45 lines (39 loc) · 1.22 KB
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
36
37
38
39
40
41
42
43
44
45
name: PR Build
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
branches:
- master
permissions:
pull-requests: write
concurrency:
group: sonar-scan-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
pr-build:
runs-on: ubuntu-latest
environment: pr-review
steps:
- name: Checkout sources
uses: actions/checkout@v7
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
allow-unsafe-pr-checkout: true
- name: Setup Gradle
uses: ./.github/actions/setup-gradle
- name: Build and Analyze
run: >
./gradlew build sonar -Pstrict
-Dsonar.pullrequest.key="$PULL_REQUEST_NUMBER"
-Dsonar.pullrequest.branch="$PULL_REQUEST_BRANCH"
-Dsonar.pullrequest.base="$PULL_REQUEST_BASE"
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
PULL_REQUEST_BRANCH: ${{ github.event.pull_request.head.ref }}
PULL_REQUEST_BASE: ${{ github.event.pull_request.base.ref }}