Skip to content

Commit a850cc1

Browse files
committed
Merge remote-tracking branch 'origin/update-from-template' into develop
2 parents e502ee6 + b24ea85 commit a850cc1

5 files changed

Lines changed: 69 additions & 8 deletions

File tree

.github/workflows/broken-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- name: Link Checker
2121
id: lychee
22-
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ jobs:
145145

146146
- name: Upload report
147147
if: always()
148-
uses: actions/upload-artifact@v6
148+
uses: actions/upload-artifact@v7
149149
with:
150150
name: pmd-report
151151
if-no-files-found: ignore
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

jacoco/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
<dependency>
243243
<groupId>com.puppycrawl.tools</groupId>
244244
<artifactId>checkstyle</artifactId>
245-
<version>13.2.0</version>
245+
<version>13.3.0</version>
246246
</dependency>
247247
</dependencies>
248248
<configuration>
@@ -280,12 +280,12 @@
280280
<dependency>
281281
<groupId>net.sourceforge.pmd</groupId>
282282
<artifactId>pmd-core</artifactId>
283-
<version>7.21.0</version>
283+
<version>7.22.0</version>
284284
</dependency>
285285
<dependency>
286286
<groupId>net.sourceforge.pmd</groupId>
287287
<artifactId>pmd-java</artifactId>
288-
<version>7.21.0</version>
288+
<version>7.22.0</version>
289289
</dependency>
290290
</dependencies>
291291
</plugin>

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<dependency>
7777
<groupId>com.puppycrawl.tools</groupId>
7878
<artifactId>checkstyle</artifactId>
79-
<version>13.2.0</version>
79+
<version>13.3.0</version>
8080
</dependency>
8181
</dependencies>
8282
<configuration>
@@ -114,12 +114,12 @@
114114
<dependency>
115115
<groupId>net.sourceforge.pmd</groupId>
116116
<artifactId>pmd-core</artifactId>
117-
<version>7.21.0</version>
117+
<version>7.22.0</version>
118118
</dependency>
119119
<dependency>
120120
<groupId>net.sourceforge.pmd</groupId>
121121
<artifactId>pmd-java</artifactId>
122-
<version>7.21.0</version>
122+
<version>7.22.0</version>
123123
</dependency>
124124
</dependencies>
125125
</plugin>

0 commit comments

Comments
 (0)