This repository was archived by the owner on Aug 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-44
lines changed Expand file tree Collapse file tree 3 files changed +21
-44
lines changed Original file line number Diff line number Diff line change 48
48
# don't fail if nothing returned by grep
49
49
set +e
50
50
CHANGES="$(git diff --name-only HEAD~1 | \
51
- grep -E "workflows/.+-container-build.yaml|Makefile|bundle/|config/|go.mod|go.sum|.+\.go|docker/|\.dockerignore" | \
52
- grep -v -E ".+_test.go|/.rhdh/")";
51
+ grep -E "workflows/.+-container-build.yaml|Makefile|bundle/|config/|go.mod|go.sum|.+\.go|docker/|\.dockerignore" | \
52
+ grep -v -E ".+_test.go|/.rhdh/")";
53
53
echo "Changed files for this commit:"
54
54
echo "=============================="
55
55
echo "$CHANGES"
Original file line number Diff line number Diff line change @@ -48,25 +48,31 @@ jobs:
48
48
run : |
49
49
echo "✓"
50
50
51
- check-changes :
52
- # check if the change for this PR necessitates a rebuild of containers
51
+ pr-build :
52
+ name : PR Publish
53
53
runs-on : ubuntu-latest
54
54
needs : authorize
55
+ permissions :
56
+ contents : read
57
+ packages : write
58
+ pull-requests : write
59
+
55
60
steps :
56
61
- name : Checkout
57
62
uses : actions/checkout@v4
58
63
with :
59
64
fetch-depth : 0
60
65
ref : ${{ github.event.pull_request.head.ref }}
61
66
repository : ${{ github.event.pull_request.head.repo.full_name }}
62
- - name : check-changes
63
- # check changes in this commit for regex include and exclude matches; pipe to an env var
67
+
68
+ # check changes in this commit for regex include and exclude matches; pipe to an env var
69
+ - name : Check for changes to build
64
70
run : |
65
71
# don't fail if nothing returned by grep
66
72
set +e
67
73
CHANGES="$(git diff --name-only HEAD~1 | \
68
- grep -E "workflows/.+-container-build.yaml|Makefile|bundle/|config/|go.mod|go.sum|.+\.go|docker/|\.dockerignore" | \
69
- grep -v -E ".+_test.go|/.rhdh/")";
74
+ grep -E "workflows/.+-container-build.yaml|Makefile|bundle/|config/|go.mod|go.sum|.+\.go|docker/|\.dockerignore" | \
75
+ grep -v -E ".+_test.go|/.rhdh/")";
70
76
echo "Changed files for this commit:"
71
77
echo "=============================="
72
78
echo "$CHANGES"
77
83
echo EOF
78
84
} >> "$GITHUB_ENV"
79
85
80
- pr-build :
81
- name : PR Publish
82
- runs-on : ubuntu-latest
83
- needs : [authorize, check-changes]
84
- permissions :
85
- contents : read
86
- packages : write
87
- pull-requests : write
88
-
89
- steps :
90
- - name : Checkout
91
- uses : actions/checkout@v4
92
- with :
93
- fetch-depth : 0
94
- ref : ${{ github.event.pull_request.head.ref }}
95
- repository : ${{ github.event.pull_request.head.repo.full_name }}
96
-
97
86
- name : Setup Go
98
87
# run this stage only if there are changes that match the includes and not the excludes
99
88
if : ${{ env.CHANGES != '' }}
Original file line number Diff line number Diff line change 22
22
- 1.[0-9]+.x
23
23
24
24
jobs :
25
- check-changes :
26
- # check if the change for this PR necessitates a rebuild of containers
25
+ pr-validate :
26
+ name : PR Validate
27
27
runs-on : ubuntu-latest
28
28
steps :
29
29
- name : Checkout
30
30
uses : actions/checkout@v4
31
31
with :
32
32
fetch-depth : 0
33
- ref : ${{ github.event.pull_request.head.ref }}
34
- repository : ${{ github.event.pull_request.head.repo.full_name }}
35
- - name : check-changes
36
- # check changes in this commit for regex include and exclude matches; pipe to an env var
37
- # note regexes are different for the PR check than for *-container-build.yaml
33
+
34
+ # check changes in this commit for regex include and exclude matches; pipe to an env var
35
+ - name : Check for changes to build
38
36
run : |
39
37
# don't fail if nothing returned by grep
40
38
set +e
41
39
CHANGES="$(git diff --name-only HEAD~1 | \
42
- grep -E "workflows/pr.yaml|Makefile|bundle/|config/|go.mod|go.sum|.+\.go" | \
43
- grep -v -E "/.rhdh/")";
40
+ grep -E "workflows/pr.yaml|Makefile|bundle/|config/|go.mod|go.sum|.+\.go" | \
41
+ grep -v -E "/.rhdh/")";
44
42
echo "Changed files for this commit:"
45
43
echo "=============================="
46
44
echo "$CHANGES"
51
49
echo EOF
52
50
} >> "$GITHUB_ENV"
53
51
54
- pr-validate :
55
- name : PR Validate
56
- runs-on : ubuntu-latest
57
- needs : check-changes
58
- steps :
59
- - name : Checkout
60
- uses : actions/checkout@v4
61
- with :
62
- fetch-depth : 0
63
-
64
52
- name : Setup Go
65
53
uses : actions/setup-go@v5
66
54
with :
You can’t perform that action at this time.
0 commit comments