File tree Expand file tree Collapse file tree 1 file changed +28
-2
lines changed Expand file tree Collapse file tree 1 file changed +28
-2
lines changed Original file line number Diff line number Diff line change 26
26
else
27
27
echo "CHANGES_DETECTED=false" >> $GITHUB_OUTPUT
28
28
fi
29
+ - name : Check for exemption for PR created by dot-org-content workflow
30
+ id : check_exemption
31
+ run : |
32
+ LABELS=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH" || echo "")
33
+ AUTHOR=$(jq -r '.pull_request.user.login' "$GITHUB_EVENT_PATH")
34
+ TITLE=$(jq -r '.pull_request.title' "$GITHUB_EVENT_PATH")
35
+ ACCEPTED_LABEL="module_reference"
36
+ ACCEPTED_AUTHOR="github-actions"
37
+ ACCEPTED_TITLE="NGINX Plus - Module Ref"
38
+
39
+ EXEMPTION=false
40
+
41
+ if echo "$LABELS" | grep -q "$ACCEPTED_LABEL"; then
42
+ echo "Label match..."
43
+ EXEMPTION=true
44
+ fi
45
+ if [[ "$AUTHOR" == "$ACCEPTED_AUTHOR" ]]; then
46
+ echo "Author match..."
47
+ EXEMPTION=true
48
+ fi
49
+ if [[ "$TITLE" == *"${ACCEPTED_TITLE}"* ]]; then
50
+ echo "Title match..."
51
+ EXEMPTION=true
52
+ fi
53
+
54
+ echo "EXEMPTION=$EXEMPTION" >> $GITHUB_OUTPUT
29
55
- name : Generate PR comment if changes detected
30
- if : steps.check_module_changes.outputs.CHANGES_DETECTED == 'true'
56
+ if : steps.check_module_changes.outputs.CHANGES_DETECTED == 'true' && steps.check_exemption.outputs.EXEMPTION == 'false'
31
57
uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
32
58
with :
33
59
script : |
39
65
body: body,
40
66
});
41
67
- name : Fail job if changes detected
42
- if : steps.check_module_changes.outputs.CHANGES_DETECTED == 'true'
68
+ if : steps.check_module_changes.outputs.CHANGES_DETECTED == 'true' && steps.check_exemption.outputs.EXEMPTION == 'false'
43
69
run : |
44
70
exit 0
You can’t perform that action at this time.
0 commit comments