Skip to content

Commit f0edec7

Browse files
authored
Upgrade GitHub Actions and improve workflow conditions
Updated GitHub Actions workflow to use version 4 of actions/checkout, actions/setup-java, and actions/upload-artifact. Adjusted conditions for job execution.
1 parent 49e32d0 commit f0edec7

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

.github/workflows/maven.yml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
name: Java CI with Maven
22
on:
33
push:
4-
branches: "master"
4+
branches: ["master"]
55
pull_request_review:
6-
branches: "master"
6+
branches: ["master"]
77
types: [submitted]
8+
89
jobs:
910
build:
10-
if: github.event_name == 'push' || github.event.review.state == 'approved'
11+
if: github.event_name == 'push' || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved')
1112
runs-on: ubuntu-latest
1213
steps:
13-
- uses: actions/checkout@v3
14-
- name: Set up JDK 17
15-
uses: actions/setup-java@v3
16-
with:
17-
java-version: '17'
18-
distribution: 'temurin'
19-
cache: maven
20-
- name: Build with Maven
21-
run: mvn package
22-
- uses: actions/upload-artifact@v3
23-
with:
24-
name: jar
25-
path: target/madgrades-final*.jar
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '17'
21+
distribution: 'temurin'
22+
cache: maven
23+
24+
- name: Build with Maven
25+
run: mvn package
26+
27+
- name: Upload JAR artifact
28+
# Updated to v4
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: jar
32+
path: target/madgrades-final*.jar
33+
if-no-files-found: error

0 commit comments

Comments
 (0)