Skip to content

Commit 9610f9f

Browse files
authored
Merge pull request #87 from openjavaformat/code-scanning-alerts
Clear the code scanning alerts in the workflows and the Dependabot config
2 parents e496bdc + 58fdede commit 9610f9f

8 files changed

Lines changed: 43 additions & 5 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
version: 2
2+
# A release is proposed only once it is a week old: a compromised or broken release is usually pulled
3+
# within days. The cooldown holds back version updates only; security updates still come at once.
24
updates:
35
- package-ecosystem: "github-actions"
46
directory: "/"
57
schedule:
68
interval: "weekly"
79
target-branch: "main"
10+
cooldown:
11+
default-days: 7
812

913
- package-ecosystem: "gradle"
1014
directory: "/"
1115
schedule:
1216
interval: "weekly"
1317
target-branch: "main"
18+
cooldown:
19+
default-days: 7

‎.github/workflows/ci.yml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22+
with:
23+
persist-credentials: false
2224

2325
- name: Install JDK 21
2426
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
@@ -63,6 +65,8 @@ jobs:
6365
out until the wrapper's Gradle supports Java 27.
6466
steps:
6567
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
68+
with:
69+
persist-credentials: false
6670

6771
- name: Install JDK ${{ matrix.jdk }} for the tests
6872
id: test-jdk
@@ -85,11 +89,14 @@ jobs:
8589
REASON: ${{ matrix.gradle_args_reason }}
8690
run: echo "::notice title=JDK ${{ matrix.jdk }} runs with $GRADLE_ARGS::$REASON"
8791

88-
# Gradle does not look into the runner's tool cache, so it is told where the test JDK is.
92+
# Gradle does not look into the runner's tool cache, so it is told where the test JDK is. The path is
93+
# a step's output, so it reaches the shell as a variable rather than being pasted into the script.
8994
- name: Build
95+
env:
96+
TEST_JDK: ${{ steps.test-jdk.outputs.path }}
9097
run: >-
9198
./gradlew test -PjavaRuntime=${{ matrix.jdk }} ${{ matrix.gradle_args }}
92-
-Porg.gradle.java.installations.paths=${{ steps.test-jdk.outputs.path }}
99+
-Porg.gradle.java.installations.paths="$TEST_JDK"
93100
94101
- name: Publish Test Report
95102
uses: mikepenz/action-junit-report@a9170d5795813c01ab4901ffb045b52bab4ab09d # v6.5.0
@@ -126,6 +133,8 @@ jobs:
126133

127134
steps:
128135
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
136+
with:
137+
persist-credentials: false
129138

130139
# The jars compile with a Java 21 toolchain, which gradle.properties looks up in JDK21_HOME. On
131140
# Linux and macOS Gradle also finds the runner's own JDK 21 by its location, on Windows it does not.

‎.github/workflows/codeql-analysis.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
steps:
2828
- name: Checkout repository
2929
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30+
with:
31+
persist-credentials: false
3032

3133
- name: Set up JDK 21
3234
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
@@ -35,7 +37,7 @@ jobs:
3537
java-version: '21'
3638

3739
- name: Initialize CodeQL
38-
uses: github/codeql-action/init@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4
40+
uses: github/codeql-action/init@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1
3941
with:
4042
languages: ${{ matrix.language }}
4143
build-mode: ${{ matrix.build-mode }}
@@ -46,6 +48,6 @@ jobs:
4648
run: ./gradlew --no-build-cache clean compileJava compileTestJava
4749

4850
- name: Perform CodeQL Analysis
49-
uses: github/codeql-action/analyze@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4
51+
uses: github/codeql-action/analyze@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1
5052
with:
5153
category: "/language:${{matrix.language}}"

‎.github/workflows/dependabot-automerge.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ permissions:
99
jobs:
1010
dependabot:
1111
runs-on: ubuntu-latest
12-
if: github.actor == 'dependabot[bot]'
12+
# Who opened the pull request, not who triggered this run: github.actor is whoever caused the event,
13+
# and a run that Dependabot triggers on someone else's pull request would pass an actor check.
14+
if: github.event.pull_request.user.login == 'dependabot[bot]'
1315
steps:
1416
- name: Fetch Dependabot metadata
1517
id: metadata

‎.github/workflows/dependency-submission.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
15+
with:
16+
persist-credentials: false
1517

1618
- name: Set up a bootstrap JDK
1719
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1

‎.github/workflows/release.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4040
with:
4141
fetch-depth: 0
42+
persist-credentials: false
4243

4344
- name: Install JDK 21
4445
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
@@ -100,6 +101,8 @@ jobs:
100101

101102
steps:
102103
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
104+
with:
105+
persist-credentials: false
103106

104107
# The Java 21 toolchain for the jars, through JDK21_HOME, as in ci.yml: Gradle does not find the
105108
# runner's own JDK 21 on Windows. Installed before GraalVM, so that Gradle still runs on GraalVM.
@@ -143,6 +146,7 @@ jobs:
143146
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
144147
with:
145148
fetch-depth: 0
149+
persist-credentials: false
146150

147151
- name: Install JDK 21
148152
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
@@ -207,6 +211,7 @@ jobs:
207211
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
208212
with:
209213
fetch-depth: 0
214+
persist-credentials: false
210215

211216
- name: Install JDK 21
212217
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
@@ -244,6 +249,7 @@ jobs:
244249
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
245250
with:
246251
fetch-depth: 0
252+
persist-credentials: false
247253

248254
- name: Install JDK 21
249255
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
@@ -286,6 +292,7 @@ jobs:
286292
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
287293
with:
288294
fetch-depth: 0
295+
persist-credentials: false
289296

290297
- name: Install JDK 21
291298
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
@@ -325,6 +332,7 @@ jobs:
325332
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
326333
with:
327334
fetch-depth: 0
335+
persist-credentials: false
328336

329337
- name: Install JDK 21
330338
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1

‎.github/workflows/sha-pinning-check.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ on:
66
push:
77
branches: [ 'main' ]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
pin-check:
1114
runs-on: ubuntu-latest
1215
steps:
1316
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
17+
with:
18+
persist-credentials: false
1419

1520
- uses: zgosalvez/github-actions-ensure-sha-pinned-actions@62574f011e0d1967d555a862bd28a7abba8684fe # v5.0.9

‎.github/workflows/update-pr-branch.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
# Run every hour to catch stuck PRs
88
- cron: '0 * * * *'
99

10+
# The action reads and updates the pull requests with BOT_PAT alone, so the workflow's own token needs
11+
# no permissions.
12+
permissions: {}
13+
1014
jobs:
1115
update:
1216
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)