forked from discourse/discourse
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.52 KB
/
Copy pathbackport.yml
File metadata and controls
52 lines (45 loc) · 1.52 KB
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
name: Backport
on:
issue_comment:
types: [created]
jobs:
backport:
if: |
github.event.issue.pull_request &&
contains(github.event.comment.body, '@discoursebot backport') &&
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
pull-requests: write
steps:
- name: Add reaction to comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
/repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions \
-f content='+1'
- name: Post start comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ github.event.issue.number }} \
--repo ${{ github.repository }} \
--body "Backport started. [View logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.GH_PUSH_TOKEN }}
- name: Configure Git
run: |
git config --global user.name "Discourse CI"
git config --global user.email "ci@ci.invalid"
- name: Perform backport
env:
GH_TOKEN: ${{ secrets.GH_PUSH_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
run: ruby script/backport.rb