From 2fd1640125dba5d6a8c3be1e0415f361d0deb4cf Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Fri, 18 Aug 2023 14:12:49 +0200 Subject: [PATCH] CI: add backport workflow Refs: https://codeberg.org/forgejo/docs/issues/18 --- .forgejo/workflows/backport.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .forgejo/workflows/backport.yml diff --git a/.forgejo/workflows/backport.yml b/.forgejo/workflows/backport.yml new file mode 100644 index 00000000..5c886534 --- /dev/null +++ b/.forgejo/workflows/backport.yml @@ -0,0 +1,29 @@ +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 + uses: https://github.com/tibdex/backport@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }}