-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (105 loc) · 3.5 KB
/
Copy pathon_pr.yml
File metadata and controls
135 lines (105 loc) · 3.5 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: on PR
# Controls when the workflow will run
on:
pull_request:
merge_group:
push:
branches:
- main
jobs:
build1:
if: ${{ github.event.label.name == 'trigger-ci' }}
runs-on: ubuntu-latest
# if: false
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run a one-line script
run: echo -e "## Report 1 \ntest1" > report_build1.md
- uses: actions/upload-artifact@v4
with:
name: report_build1
path: report_build1.md
- run: cat aaaaa.txt
build2:
if: ${{ github.event.label.name == 'trigger-ci' }}
runs-on: ubuntu-latest
# if: false
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run a one-line script
run: echo -e "## Report 2 \ntest2" > report_build2.md
- uses: actions/upload-artifact@v4
with:
name: report_build2
path: report_build2.md
build3:
runs-on: ubuntu-latest
# if: false
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run a one-line script
run: echo -e "## Report 3 \ntest3" > report_a_precommit.md
- uses: actions/upload-artifact@v4
with:
name: report_build3
path: report_a_precommit.md
build5:
runs-on: ubuntu-latest
# if: false
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run a one-line script
run: echo -e "## Comment a \ntesta" > pr_comment_a.md
- uses: actions/upload-artifact@v4
with:
name: pr_comment_a
path: pr_comment_a.md
build4:
runs-on: ubuntu-latest
# if: false
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run a one-line script
run: echo -e "## Report 4 \ntest4" > report_aa_test.md
- uses: actions/upload-artifact@v4
with:
name: report_build4
path: report_aa_test.md
upload_pr_detail:
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
mkdir -p ./pr
echo $PR_NUMBER > ./pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: report_pr_number
path: ./pr_number.txt
email_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Extract author email
id: author
run: |
git log -1
echo "email=$(git show -s --format='%ae' HEAD~0)" >> $GITHUB_OUTPUT
- name: Show email
run: echo "Commiter email is ${{ steps.author.outputs.email }}" > report______email.md
- name: Validate author email
if: ${{ endsWith(steps.author.outputs.EMAIL, 'noreply.github.com') }}
run: echo "You are using github private e-mail. This prevent proper tracing of who contributed what, please disable it (see [Keep my email addresses private](https://github.com/settings/emails))." >> report______email.md
- uses: actions/upload-artifact@v4
with:
name: report_email
path: ./report______email.md