Skip to content

Commit d96e449

Browse files
committed
(wip) Added exemption code
1 parent 73b299b commit d96e449

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/block-changes.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,32 @@ jobs:
2626
else
2727
echo "CHANGES_DETECTED=false" >> $GITHUB_OUTPUT
2828
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 = "<TODO>"
37+
ACCEPTED_TITLE = "NGINX Plus - Module Ref"
38+
39+
EXEMPTION=false
40+
41+
if echo "$LABELS" | grep -q "$ACCEPTED_LABEL"; then
42+
EXEMPTION=true
43+
fi
44+
if [[ "$AUTHOR" == "$ACCEPTED_AUTHOR" ]]; then
45+
EXEMPTION=true
46+
fi
47+
if [[ "$TITLE" == *"${ACCEPTED_TITLE}"* ]]; then
48+
EXEMPTION=true
49+
fi
50+
51+
echo "EXEMPTION=$EXEMPTION" >> $GITHUB_OUTPUT
52+
2953
- name: Generate PR comment if changes detected
30-
if: steps.check_module_changes.outputs.CHANGES_DETECTED == 'true'
54+
if: steps.check_module_changes.outputs.CHANGES_DETECTED == 'true' && steps.check_exemption.outputs.EXEMPTION == 'false'
3155
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
3256
with:
3357
script: |

0 commit comments

Comments
 (0)