summaryrefslogtreecommitdiffstats
path: root/.forgejo/workflows/backport.yml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
committerDaniel Baumann <daniel@debian.org>2024-12-12 23:57:56 +0100
commite68b9d00a6e05b3a941f63ffb696f91e554ac5ec (patch)
tree97775d6c13b0f416af55314eb6a89ef792474615 /.forgejo/workflows/backport.yml
parentInitial commit. (diff)
downloadforgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.tar.xz
forgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.zip
Adding upstream version 9.0.3.
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to '')
-rw-r--r--.forgejo/workflows/backport.yml59
1 files changed, 59 insertions, 0 deletions
diff --git a/.forgejo/workflows/backport.yml b/.forgejo/workflows/backport.yml
new file mode 100644
index 0000000..fca01a1
--- /dev/null
+++ b/.forgejo/workflows/backport.yml
@@ -0,0 +1,59 @@
+# Copyright 2024 The Forgejo Authors
+# SPDX-License-Identifier: MIT
+#
+# To modify this workflow:
+#
+# - change pull_request_target: to pull_request:
+# so that it runs from a pull request instead of the default branch
+#
+# - push it to the wip-ci-backport branch on the forgejo repository
+# otherwise it will not have access to the secrets required to push
+# the PR
+#
+# - open a pull request targetting wip-ci-backport that includes a change
+# that can be backported without conflict in v1.21 and set the
+# `backport/v1.21` label.
+#
+# - once it works, open a pull request for the sake of keeping track
+# of the change even if the PR won't run it because it will use
+# whatever is in the default branch instead
+#
+# - after it is merged, double check it works by setting a
+# `backport/v1.21` label on a merged pull request that can be backported
+# without conflict.
+#
+on:
+ pull_request_target:
+ types:
+ - closed
+ - labeled
+
+jobs:
+ backporting:
+ if: >
+ ( vars.ROLE == 'forgejo-coding' ) && (
+ github.event.pull_request.merged
+ &&
+ contains(toJSON(github.event.pull_request.labels), 'backport/v')
+ )
+ runs-on: docker
+ container:
+ image: 'code.forgejo.org/oci/node:20-bookworm'
+ steps:
+ - name: event info
+ run: |
+ cat <<'EOF'
+ ${{ toJSON(github) }}
+ EOF
+ - uses: https://code.forgejo.org/actions/git-backporting@v4.8.0
+ with:
+ target-branch-pattern: "^backport/(?<target>(v.*))$"
+ strategy: ort
+ strategy-option: find-renames
+ cherry-pick-options: -x
+ auth: ${{ secrets.BACKPORT_TOKEN }}
+ pull-request: ${{ github.event.pull_request.url }}
+ auto-no-squash: true
+ enable-err-notification: true
+ git-user: forgejo-backport-action
+ git-email: forgejo-backport-action@noreply.codeberg.org