File tree Expand file tree Collapse file tree 2 files changed +33
-19
lines changed Expand file tree Collapse file tree 2 files changed +33
-19
lines changed Original file line number Diff line number Diff line change 4
4
branches :
5
5
- master
6
6
- main
7
- types : [ ' opened', ' synchronize' ]
7
+ types : [" opened", " synchronize" ]
8
8
paths :
9
- - ' quickstarts/**'
10
- - ' solution/**'
9
+ - " quickstarts/**/**.tf "
10
+ - " solution/**/**.tf "
11
11
12
12
jobs :
13
13
terraform-fmt :
21
21
terraform -chdir=quickstarts fmt -check -recursive
22
22
terraform -chdir=solution fmt -check -recursive
23
23
24
-
25
24
terraform-validate :
26
25
runs-on : ubuntu-latest
27
26
steps :
34
33
dir_names : " true"
35
34
separator : " ,"
36
35
files : |
37
- quickstarts/*
38
- solution/*
36
+ {quickstarts,solution}/**/*.tf
39
37
dir_names_max_depth : 3
40
38
- name : Terraform validate
41
39
run : |
@@ -58,38 +56,29 @@ jobs:
58
56
fi
59
57
done
60
58
61
-
62
59
e2e-check :
63
60
needs : [terraform-fmt, terraform-validate]
64
61
runs-on : ubuntu-latest
65
62
name : e2e check
66
63
steps :
67
64
- name : checkout
68
65
uses : actions/checkout@v3
69
- - name : Checking the max commits number
70
- run : |
71
- commitNum=${{ github.event.pull_request.commits }}
72
- if [[ ${commitNum} -gt 1 ]]; then
73
- echo -e "\nERROR: The PR has ${commitNum} commits, and please rebase it to 1.\n"
74
- exit 1
75
- fi
76
66
- name : Get changed files
77
67
id : changed-files
78
- uses : tj-actions/changed-files@v34
68
+ uses : tj-actions/changed-files@v46
79
69
with :
80
70
dir_names : " true"
81
71
separator : " ,"
82
72
files : |
83
- quickstarts/*
84
- solution/*
73
+ {quickstarts,solution}/**/*.tf
85
74
dir_names_max_depth : 3
86
75
- name : set id
87
76
id : set-job-id
88
77
uses : ayachensiyuan/get-action-job-id@v1.6
89
- env :
78
+ env :
90
79
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
91
80
with :
92
- job-name : ' e2e check'
81
+ job-name : " e2e check"
93
82
- name : get pull request info
94
83
run : |
95
84
echo "repo name is" ${{github.event.pull_request.head.repo.full_name}}
Original file line number Diff line number Diff line change
1
+ name : Pull Request
2
+ on :
3
+ pull_request :
4
+ branches :
5
+ - master
6
+ - main
7
+ types : ["opened", "synchronize"]
8
+ paths :
9
+ - " quickstarts/**"
10
+ - " solution/**"
11
+
12
+ jobs :
13
+ commit-check :
14
+ runs-on : ubuntu-latest
15
+ name : commit check
16
+ steps :
17
+ - name : checkout
18
+ uses : actions/checkout@v3
19
+ - name : Checking the max commits number
20
+ run : |
21
+ commitNum=${{ github.event.pull_request.commits }}
22
+ if [[ ${commitNum} -gt 1 ]]; then
23
+ echo -e "\nERROR: The PR has ${commitNum} commits, and please rebase it to 1.\n"
24
+ exit 1
25
+ fi
You can’t perform that action at this time.
0 commit comments