File tree 5 files changed +53
-7
lines changed
5 files changed +53
-7
lines changed Original file line number Diff line number Diff line change
1
+ name : Automerge Backport
2
+ on :
3
+ pull_request :
4
+ pull_request_review :
5
+ types :
6
+ - submitted
7
+ check_suite :
8
+ types :
9
+ - completed
10
+ status : {}
11
+ jobs :
12
+ automerge-backport :
13
+ if : |
14
+ github.repository == 'opensearch-project/documentation-website' &&
15
+ startsWith(github.event.pull_request.head.ref, 'backport/')
16
+ runs-on : ubuntu-latest
17
+ steps :
18
+ - name : Wait some time so that label and approval is up
19
+ run : sleep 30
20
+ - id : automerge
21
+ name : automerge
22
+ uses :
" pascalgn/[email protected] "
23
+ env :
24
+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
25
+ MERGE_LABELS : " backport-automerge,!On hold"
26
+ MERGE_FILTER_AUTHOR : " opensearch-trigger-bot[bot]"
27
+ MERGE_REQUIRED_APPROVALS : " 1"
28
+ MERGE_RETRIES : " 20"
29
+ MERGE_RETRY_SLEEP : " 10000"
30
+ MERGE_ERROR_FAIL : " true"
31
+ MERGE_FORKS : " false"
32
+ MERGE_METHOD : " squash"
33
+ MERGE_DELETE_BRANCH : " true"
Original file line number Diff line number Diff line change 42
42
43
43
- name : Label new backport PR with backport-automerge label
44
44
run : |
45
- PR_BRANCH=backport/backport-${{ github.event.pull_request.number }}-to-`echo ${{ github.event.label.name }} | cut -d ' ' -f2`
46
- PR_NUMBER=`gh pr list -R opensearch-project/documentation-website --json "number,headRefName" --state open | jq -r ".[] | select(.headRefName == \"$PR_BRANCH\") | .number"`
47
- echo "Update Backport PR '#$PR_NUMBER' on branch '$PR_BRANCH' with 'backport-automerge' label"
48
- gh issue edit -R opensearch-project/documentation-website $PR_NUMBER --add-label backport-automerge
45
+ PR_LABELS=`echo "${{ toJson(github.event.pull_request.labels.*.name) }}" | sed -e 's/\[//g;s/\]//g;s/^\s*//g;s/\s*$//g' | tr -d '\n'`
46
+ echo $PR_LABELS
47
+ OLDIFS=$IFS
48
+ export IFS=','
49
+ for label in $PR_LABELS
50
+ do
51
+ if [[ "$label" == "backport"* ]]; then
52
+ echo "Found label \"$label\""
53
+ PR_REPO="opensearch-project/documentation-website"
54
+ PR_BRANCH=backport/backport-${{ github.event.pull_request.number }}-to-`echo $label | cut -d ' ' -f2`
55
+ PR_NUMBER=`gh pr list -R $PR_REPO --json "number,headRefName" --state open | jq -r ".[] | select(.headRefName == \"$PR_BRANCH\") | .number"`
56
+ echo "Update Backport PR '#$PR_NUMBER' on branch '$PR_BRANCH' with 'backport-automerge' label"
57
+ gh issue edit -R $PR_REPO $PR_NUMBER --add-label backport-automerge
58
+ echo "Auto approve $PR_REPO PR #$PR_NUMBER with opensearch-trigger-bot"
59
+ gh pr review -R $PR_REPO $PR_NUMBER --approve
60
+ fi
61
+ done
49
62
env :
50
63
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: Jekyll Build Verification
3
3
on : [pull_request]
4
4
5
5
jobs :
6
- check :
6
+ jekyll-build :
7
7
runs-on : ubuntu-latest
8
8
9
9
steps :
Original file line number Diff line number Diff line change 4
4
schedule :
5
5
- cron : " 30 11 * * 0"
6
6
jobs :
7
- check :
7
+ link-checker :
8
8
if : github.repository == 'opensearch-project/documentation-website'
9
9
runs-on : ubuntu-latest
10
10
steps :
Original file line number Diff line number Diff line change 1
- name : Style check
1
+ name : Style Check
2
2
3
3
on :
4
4
pull_request :
You can’t perform that action at this time.
0 commit comments