0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-05 16:23:34 +08:00
discourse/.github/workflows/backport.yml
dependabot[bot] d5c21891b4
DEPS: Bump actions/checkout from 6 to 7 (#41156)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to
7.
- [Release notes](https://github.com/actions/checkout/releases)
-
[Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-24 21:54:51 +02:00

56 lines
1.7 KiB
YAML
Vendored

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) ||
github.event.comment.user.login == 'patch-triage[bot]'
)
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@v7
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 }}
COMMENT_BODY: ${{ github.event.comment.body }}
run: ruby script/backport.rb