generated from pagopa/template-java-spring-microservice
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (84 loc) · 3.25 KB
/
check_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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Check PR
# Controls when the workflow will run
on:
merge_group:
pull_request:
branches:
- main
- next
types: [ opened, synchronize, labeled, unlabeled, reopened, edited ]
permissions:
contents: read
checks: write
issues: write
pull-requests: write
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
auto_assign:
name: Auto Assign
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Assign Me
# You may pin to the exact commit or the version.
uses: kentaro-m/auto-assign-action@746a3a558fdd0e061f612ec9f8ff1b8a19c1a115 # v1.2.1
with:
configuration-path: '.github/auto_assign.yml'
check_labels:
name: Check Required Labels
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 # required to make the script available for next step
- name: Verify PR Labels
if: ${{ !contains(github.event.pull_request.labels.*.name, 'major') && !contains(github.event.pull_request.labels.*.name, 'minor') && !contains(github.event.pull_request.labels.*.name, 'patch') && !contains(github.event.pull_request.labels.*.name, 'patch') && !contains(github.event.pull_request.labels.*.name, 'skip') }}
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6.3.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('./.github/workflows/github_scripts/check_required_labels.js')
script({github, context, core})
formatter:
name: Formatter
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '21'
- name: Find incorrectly formatted file
uses: axel-op/googlejavaformat-action@v3
with:
args: "--replace"
skip-commit: true
- name: Print diffs
run: git --no-pager diff
- name: suggester / google-java-format
uses: reviewdog/action-suggester@db4abb16fbaabe386831e5addb7be1485d0d63d3 # v1
with:
tool_name: google-java-format
- name: Check Format
uses: axel-op/googlejavaformat-action@v3
with:
args: "--set-exit-if-changed"
check_size:
runs-on: ubuntu-latest
name: Check Size
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
fetch-depth: 0
- name: Check Size
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6.3.3
env:
IGNORED_FILES: openapi.json
BRANCH_NAME: ${{ github.head_ref}}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('./.github/workflows/github_scripts/check_size.js')
await script({github, context, core})