File tree 8 files changed +108
-20
lines changed
8 files changed +108
-20
lines changed Load Diff This file was deleted.
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 16
16
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
17
17
if : >
18
18
github.event.pull_request.merged
19
+ && github.repository == 'opensearch-project/documentation-website'
19
20
&& (
20
21
github.event.action == 'closed'
21
22
|| (
38
39
with :
39
40
github_token : ${{ steps.github_app_token.outputs.token }}
40
41
head_template : backport/backport-<%= number %>-to-<%= base %>
42
+
43
+ - name : Label new backport PR with backport-automerge label
44
+ run : |
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
62
+ env :
63
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ name : Delete merged branch of the PRs
2
+ on :
3
+ pull_request :
4
+ types :
5
+ - closed
6
+
7
+ jobs :
8
+ delete-branch :
9
+ runs-on : ubuntu-latest
10
+ if : |
11
+ github.repository == 'opensearch-project/documentation-website' &&
12
+ ${{ !startsWith(github.event.pull_request.head.ref, 'main') }} &&
13
+ ${{ !startsWith(github.event.pull_request.head.ref, '1.') }} &&
14
+ ${{ !startsWith(github.event.pull_request.head.ref, '2.') }} &&
15
+ ${{ !startsWith(github.event.pull_request.head.ref, 'version/') }}
16
+ steps :
17
+ - name : Echo remove branch
18
+ run : echo Removing ${{github.event.pull_request.head.ref}}
19
+ - name : Delete merged branch
20
+ uses : SvanBoxel/delete-merged-branch@main
21
+ env :
22
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
1
+ name : Encoding Checker
2
+
3
+ on : [pull_request]
4
+
5
+ jobs :
6
+ encoding-checker :
7
+ runs-on : ubuntu-latest
8
+ steps :
9
+ - name : Checkout repository
10
+ uses : actions/checkout@v3
11
+ - name : Check for possible file that does not follow utf-8 encoding
12
+ run : |
13
+ set +e
14
+ IFS=$(echo -en "\n\b")
15
+ COUNTER=0
16
+ for i in `find . -type f \( -name "*.txt" -o -name "*.md" -o -name "*.markdown" -o -name "*.html" \) | grep -vE "^./.git"`;
17
+ do
18
+ grep -axv '.*' "$i"
19
+ if [ "$?" -eq 0 ]; then
20
+ echo -e "######################\n$i\n######################"
21
+ COUNTER=$(( COUNTER + 1 ))
22
+ fi
23
+ done
24
+ if [ "$COUNTER" != 0 ]; then
25
+ echo "Found files that is not following utf-8 encoding, exit 1"
26
+ exit 1
27
+ fi
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 :
8
- if : github.repository == ‘ opensearch-project/documentation-website’
7
+ link-checker :
8
+ if : github.repository == ' opensearch-project/documentation-website'
9
9
runs-on : ubuntu-latest
10
10
steps :
11
11
- uses : actions/checkout@v3
You can’t perform that action at this time.
0 commit comments