Skip to content

Commit e94be2b

Browse files
committed
Merge remote-tracking branch 'origin/update-from-template' into develop
2 parents 2ea7ee0 + 2e29c7a commit e94be2b

17 files changed

Lines changed: 291 additions & 446 deletions

.config/checkstyle/checkstyle.xml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@
7474
<!-- https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#avoidcatchingthrowable -->
7575
<property name="illegalClassNames" value="Error,Throwable,NullPointerException,java.lang.Error,java.lang.Throwable,java.lang.NullPointerException"/>
7676
</module>
77+
<!-- Do not allow params and vars to end with collection type names -->
78+
<module name="IllegalIdentifierName">
79+
<property name="format" value="^(?!(.*(Map|List|Set))$).+$"/>
80+
<property name="tokens" value="PARAMETER_DEF, VARIABLE_DEF, PATTERN_VARIABLE_DEF, RECORD_COMPONENT_DEF, LAMBDA"/>
81+
</module>
82+
<!-- Name classes correctly and don't use generic name for everything -->
83+
<module name="IllegalIdentifierName">
84+
<property name="format" value="^(?!(.*(Helper|Util))$).+$"/>
85+
<property name="tokens" value=" CLASS_DEF"/>
86+
</module>
7787
<module name="IllegalImport"/>
7888
<module name="InterfaceIsType"/>
7989
<module name="JavadocStyle">
@@ -91,7 +101,7 @@
91101
<property name="ignoreFieldDeclaration" value="true"/>
92102
<property name="ignoreHashCodeMethod" value="true"/>
93103
<!-- Defaults + other common constant values (e.g. time) -->
94-
<property name="ignoreNumbers" value="-1, 0, 1, 2, 3, 4, 5, 10, 12, 24, 31, 60, 100, 1000"/>
104+
<property name="ignoreNumbers" value="-1, 0, 1, 2, 3, 4, 5, 8, 10, 12, 16, 24, 25, 31, 32, 50, 60, 64, 100, 128, 200, 256, 500, 512, 1000, 1024, 2000, 2048, 4000, 4096, 8000, 8192"/>
95105
</module>
96106
<module name="MemberName"/>
97107
<module name="MethodLength"/>
@@ -123,7 +133,8 @@
123133
<module name="StringLiteralEquality"/>
124134
<module name="SuppressWarningsHolder"/>
125135
<module name="TodoComment">
126-
<property name="severity" value="info"/>
136+
<!-- Default is "TODO:" -->
137+
<property name="format" value="(?i)(TODO)"/>
127138
</module>
128139
<module name="TypecastParenPad"/>
129140
<module name="TypeName"/>

.config/pmd/java/ruleset.xml

Lines changed: 152 additions & 90 deletions
Large diffs are not rendered by default.

.config/topo/upstream.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- url: https://github.com/xdev-software/standard-maven-template.git
2+
branch: master

.github/workflows/broken-links.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414
timeout-minutes: 15
1515
steps:
16-
- uses: actions/checkout@v5
16+
- uses: actions/checkout@v6
1717

1818
- run: mv .github/.lycheeignore .lycheeignore
1919

2020
- name: Link Checker
2121
id: lychee
22-
uses: lycheeverse/lychee-action@885c65f3dc543b57c898c8099f4e08c8afd178a2 # v2
22+
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2
2323
with:
2424
fail: false # Don't fail on broken links, create an issue instead
2525

.github/workflows/check-build.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
java: [17, 21, 25]
2929
distribution: [temurin]
3030
steps:
31-
- uses: actions/checkout@v5
31+
- uses: actions/checkout@v6
3232

3333
- name: Set up JDK
3434
uses: actions/setup-java@v5
@@ -37,7 +37,7 @@ jobs:
3737
java-version: ${{ matrix.java }}
3838

3939
- name: Cache Maven
40-
uses: actions/cache@v4
40+
uses: actions/cache@v5
4141
with:
4242
path: ~/.m2/repository
4343
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
@@ -71,10 +71,10 @@ jobs:
7171
timeout-minutes: 15
7272
strategy:
7373
matrix:
74-
java: [17]
74+
java: [21]
7575
distribution: [temurin]
7676
steps:
77-
- uses: actions/checkout@v5
77+
- uses: actions/checkout@v6
7878

7979
- name: Set up JDK
8080
uses: actions/setup-java@v5
@@ -83,15 +83,15 @@ jobs:
8383
java-version: ${{ matrix.java }}
8484

8585
- name: Cache Maven
86-
uses: actions/cache@v4
86+
uses: actions/cache@v5
8787
with:
8888
path: ~/.m2/repository
8989
key: ${{ runner.os }}-mvn-checkstyle-${{ hashFiles('**/pom.xml') }}
9090
restore-keys: |
9191
${{ runner.os }}-mvn-checkstyle-
9292
9393
- name: CheckStyle Cache
94-
uses: actions/cache@v4
94+
uses: actions/cache@v5
9595
with:
9696
path: '**/target/checkstyle-cachefile'
9797
key: ${{ runner.os }}-checkstyle-${{ hashFiles('**/pom.xml') }}
@@ -110,7 +110,7 @@ jobs:
110110
java: [17]
111111
distribution: [temurin]
112112
steps:
113-
- uses: actions/checkout@v5
113+
- uses: actions/checkout@v6
114114

115115
- name: Set up JDK
116116
uses: actions/setup-java@v5
@@ -119,15 +119,15 @@ jobs:
119119
java-version: ${{ matrix.java }}
120120

121121
- name: Cache Maven
122-
uses: actions/cache@v4
122+
uses: actions/cache@v5
123123
with:
124124
path: ~/.m2/repository
125125
key: ${{ runner.os }}-mvn-pmd-${{ hashFiles('**/pom.xml') }}
126126
restore-keys: |
127127
${{ runner.os }}-mvn-pmd-
128128
129129
- name: PMD Cache
130-
uses: actions/cache@v4
130+
uses: actions/cache@v5
131131
with:
132132
path: '**/target/pmd/pmd.cache'
133133
key: ${{ runner.os }}-pmd-${{ hashFiles('**/pom.xml') }}
@@ -141,8 +141,8 @@ jobs:
141141
run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C
142142

143143
- name: Upload report
144-
if: always()
145-
uses: actions/upload-artifact@v4
144+
if: ${{ !cancelled() }}
145+
uses: actions/upload-artifact@v7
146146
with:
147147
name: pmd-report
148148
if-no-files-found: ignore

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
timeout-minutes: 30
2020
steps:
21-
- uses: actions/checkout@v5
21+
- uses: actions/checkout@v6
2222

2323
- name: Set up JDK
2424
uses: actions/setup-java@v5
@@ -28,7 +28,7 @@ jobs:
2828

2929
# Try to reuse existing cache from check-build
3030
- name: Try restore Maven Cache
31-
uses: actions/cache/restore@v4
31+
uses: actions/cache/restore@v5
3232
with:
3333
path: ~/.m2/repository
3434
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
@@ -63,7 +63,7 @@ jobs:
6363
outputs:
6464
upload_url: ${{ steps.create-release.outputs.upload_url }}
6565
steps:
66-
- uses: actions/checkout@v5
66+
- uses: actions/checkout@v6
6767

6868
- name: Configure Git
6969
run: |
@@ -91,7 +91,7 @@ jobs:
9191
9292
- name: Create Release
9393
id: create-release
94-
uses: shogo82148/actions-create-release@28d99e2a5b407558d17c15d0384fc0d7fb625b4c # v1
94+
uses: shogo82148/actions-create-release@6a396031bc74c57403da1018fec74d24c6aa03cd # v1
9595
with:
9696
tag_name: v${{ steps.version.outputs.release }}
9797
release_name: v${{ steps.version.outputs.release }}
@@ -113,7 +113,7 @@ jobs:
113113
needs: [prepare-release]
114114
timeout-minutes: 60
115115
steps:
116-
- uses: actions/checkout@v5
116+
- uses: actions/checkout@v6
117117

118118
- name: Init Git and pull
119119
run: |
@@ -161,7 +161,7 @@ jobs:
161161
needs: [prepare-release]
162162
timeout-minutes: 15
163163
steps:
164-
- uses: actions/checkout@v5
164+
- uses: actions/checkout@v6
165165

166166
- name: Init Git and pull
167167
run: |
@@ -177,7 +177,7 @@ jobs:
177177

178178
# Try to reuse existing cache from check-build
179179
- name: Try restore Maven Cache
180-
uses: actions/cache/restore@v4
180+
uses: actions/cache/restore@v5
181181
with:
182182
path: ~/.m2/repository
183183
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
@@ -200,7 +200,7 @@ jobs:
200200
needs: [publish-maven]
201201
timeout-minutes: 10
202202
steps:
203-
- uses: actions/checkout@v5
203+
- uses: actions/checkout@v6
204204

205205
- name: Init Git and pull
206206
run: |
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Report workflow security problems
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ develop ]
7+
paths:
8+
- '.github/workflows/**'
9+
10+
permissions:
11+
issues: write
12+
13+
jobs:
14+
prt:
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 15
17+
# Only run this in our repos (Prevent notification spam by forks)
18+
if: ${{ github.repository_owner == 'xdev-software' }}
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- name: Check
23+
id: check
24+
run: |
25+
grep -l 'pull_request_target:' --exclude report-gha-workflow-security-problems.yml *.yml > reported.txt && exit 1 || exit 0
26+
working-directory: .github/workflows
27+
28+
- name: Find already existing issue
29+
id: find-issue
30+
if: ${{ !cancelled() }}
31+
run: |
32+
echo "number=$(gh issue list -l 'bug' -l 'automated' -L 1 -S 'in:title "Incorrectly configure GHA workflow (prt)"' -s 'open' --json 'number' --jq '.[].number')" >> $GITHUB_OUTPUT
33+
env:
34+
GH_TOKEN: ${{ github.token }}
35+
36+
- name: Close issue if everything is fine
37+
if: ${{ success() && steps.find-issue.outputs.number != '' }}
38+
run: gh issue close -r 'not planned' ${{ steps.find-issue.outputs.number }}
39+
env:
40+
GH_TOKEN: ${{ github.token }}
41+
42+
- name: Create report
43+
if: ${{ failure() && steps.check.conclusion == 'failure' }}
44+
run: |
45+
echo 'Detected usage of `pull_request_target`. This event is dangerous and MUST NOT BE USED AT ALL COST!' > reported.md
46+
echo '' >> reported.md
47+
echo '/cc @xdev-software/gha-workflow-security' >> reported.md
48+
echo '' >> reported.md
49+
echo '```' >> reported.md
50+
cat .github/workflows/reported.txt >> reported.md
51+
echo '```' >> reported.md
52+
cat reported.md
53+
54+
- name: Create Issue From File
55+
if: ${{ failure() && steps.check.conclusion == 'failure' }}
56+
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6
57+
with:
58+
issue-number: ${{ steps.find-issue.outputs.number }}
59+
title: 'Incorrectly configure GHA workflow (prt)'
60+
content-filepath: ./reported.md
61+
labels: bug, automated

.github/workflows/sync-labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
timeout-minutes: 10
1818
steps:
19-
- uses: actions/checkout@v5
19+
- uses: actions/checkout@v6
2020
with:
2121
sparse-checkout: .github/labels.yml
2222

.github/workflows/test-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 60
1313
steps:
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v6
1515

1616
- name: Set up JDK
1717
uses: actions/setup-java@v5

0 commit comments

Comments
 (0)