forked from hazelcast/hazelcast
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (42 loc) · 1.61 KB
/
common-synchronize-pr-reviewers.yaml
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
name: Synchronize PR reviewers
on:
pull_request_target:
branches:
- "master"
- "[0-9]+.[0-9]+.z"
- "[0-9]+.[0-9]+.[0-9]"
- "[0-9]+.[0-9]+.[0-9]+-BETA-[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+-DEVEL-[0-9]+"
- "data-migration-5.3"
types:
- review_requested
- review_request_removed
jobs:
synchronize-pr-reviewers:
runs-on: ubicloud-standard-2
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: .github
- name: Copy reviewers to other PR
run: |
SOURCE_REPO="${{ github.repository }}"
SOURCE_PR="${{ github.event.pull_request.number }}"
CONTENT="$(gh pr view "$SOURCE_PR" --json "body,comments" -q '.body, .comments[].body')"
while read -r line; do
if [[ $line =~ (Closes|Internal\ PR)\ ([^/]+/[^/]+)#([0-9]+) ]]; then
TARGET_REPO="${BASH_REMATCH[2]}"
TARGET_PR="${BASH_REMATCH[3]}"
.github/workflows/common-synchronize-pr-reviewers.sh $SOURCE_REPO $SOURCE_PR $TARGET_REPO $TARGET_PR
fi
done <<< "$CONTENT"
env:
GH_TOKEN: ${{ secrets.DEVOPSHAZELCAST_PAT_FOR_MONOREPO }}
- uses: 8398a7/action-slack@v3
if: failure()
with:
fields: repo,message,author,action,eventName,workflow,job,pullRequest
status: failure
channel: "#monorepo-notifications"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_MONOREPO }}