0
0
Fork 0
mirror of https://codeberg.org/forgejo/docs.git synced 2024-11-27 18:32:37 -05:00
forgejo-docs/.forgejo/workflows/backport.yml
2023-08-18 23:44:21 +01:00

32 lines
927 B
YAML

name: backport
on:
pull_request_target:
types:
- closed
- labeled
jobs:
backport:
runs-on: docker
container:
image: node:20-bookworm
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
steps:
- name: send backport if the label "backport {branch}" is present
if: secrets.WEBSITETOKEN != ''
uses: https://github.com/tibdex/backport@v2
with:
github_token: ${{ secrets.WEBSITETOKEN }}
head_template: 'backport/<%= base %>/pr-<%= number %>'
label_pattern: '^backport/(?<base>([^ ]+))$'