-
Notifications
You must be signed in to change notification settings - Fork 44
37 lines (34 loc) · 1021 Bytes
/
ci.yml
File metadata and controls
37 lines (34 loc) · 1021 Bytes
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
name: shengsheng-CI
on:
pull_request_target:
branches: [ main ]
types: [opened,synchronize, labeled ,unlabeled]
jobs:
check-ci-approve:
name: ci-approve
runs-on: ubuntu-latest
steps:
- name: Check for ci-approve label
uses: actions/github-script@v7
with:
script: |
const labels = context.payload.pull_request.labels.map(label => label.name);
if (!labels.includes('ci-approve')) {
core.setFailed('请等待 ci-approve 标签');
}
run-tests:
needs: check-ci-approve
runs-on: ubuntu-latest
steps:
- name: Checkout PR code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Run Maven Tests
run: mvn test