-
Notifications
You must be signed in to change notification settings - Fork 132
54 lines (50 loc) · 1.64 KB
/
breaking_change_reminder.yml
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
name: Workflow for Breaking Change Reminder
on:
pull_request:
paths:
# below files do not cover all the exposed types/funcs, but it's a good start to detect potentially breaking changes
- activity/activity.go
- client/client.go
- encoded/encoded.go
- interceptors/workflow_interceptor.go
- internal/activity.go
- internal/client.go
- internal/encoded.go
- internal/workflow.go
- internal/interceptors.go
- internal/worker.go
- internal/workflow.go
- worker/worker.go
- workflow/*.go
jobs:
breaking-change-pr-template-reminder:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fail if PR description is missing breaking change template
if: steps.pr-changes.outputs.changes != '[]'
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
PR_URL="https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER}"
BODY=$(curl $PR_URL | jq '.body')
CHECKLIST=(
"Detailed Description"
"Impact Analysis"
"Testing Plan"
"Rollout Plan"
)
TEMPLATE=$(cat .github/workflows/breaking_change_pr_template.md)
for i in "${CHECKLIST[@]}"; do
if [[ "$BODY" == *"$i"* ]]; then
continue
else
echo "Potential breaking changes detected! Please update the PR description to include following template:"
echo "---"
echo "$TEMPLATE"
echo "---"
exit 1
fi
done