-
Notifications
You must be signed in to change notification settings - Fork 680
38 lines (32 loc) · 1.15 KB
/
release-backport.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
name: Backport
on:
issue_comment:
types: [created]
workflow_dispatch:
pull_request:
jobs:
bench:
if: |
github.event.issue.pull_request != null &&
contains(github.event.comment.body, '/backport')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: ACK Comment
run: |
gh api -X POST /repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions --input - <<EOF
{
"content": "rocket"
}
EOF
- name: Check Branch
if: github.event.issue.pull_request.base.ref != 'master'
run: |
gh issue comment ${{ github.event.issue.number }} --body "🤖 Backport: error: can only backport Pull Requests that target branch 'master'"
exit 1
- name: Comment
run: |
COMMENT_ID=$(gh issue comment ${{ github.event.issue.number }} --json id --jq '.id' --body \
"🤖 Backport: starting CI process, you can cancel it [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})")
echo "COMMENT_ID=$COMMENT_ID" >> $GITHUB_ENV