2024-03-23 04:39:23 -04:00
|
|
|
# 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: >
|
2024-11-13 16:18:35 -05:00
|
|
|
( vars.ROLE == 'forgejo-coding' ) && (
|
2024-03-23 04:39:23 -04:00
|
|
|
github.event.pull_request.merged
|
2024-03-30 08:35:56 -04:00
|
|
|
&&
|
|
|
|
contains(toJSON(github.event.pull_request.labels), 'backport/v')
|
2024-03-23 04:39:23 -04:00
|
|
|
)
|
|
|
|
runs-on: docker
|
|
|
|
container:
|
2024-08-12 10:11:35 -04:00
|
|
|
image: 'code.forgejo.org/oci/node:20-bookworm'
|
2024-03-23 04:39:23 -04:00
|
|
|
steps:
|
2024-03-30 19:22:51 -04:00
|
|
|
- name: event info
|
|
|
|
run: |
|
|
|
|
cat <<'EOF'
|
|
|
|
${{ toJSON(github) }}
|
|
|
|
EOF
|
2024-11-02 20:03:53 -04:00
|
|
|
- uses: https://code.forgejo.org/actions/git-backporting@v4.8.4
|
2024-03-23 04:39:23 -04:00
|
|
|
with:
|
2024-04-11 04:15:38 -04:00
|
|
|
target-branch-pattern: "^backport/(?<target>(v.*))$"
|
2024-03-30 04:44:19 -04:00
|
|
|
strategy: ort
|
|
|
|
strategy-option: find-renames
|
2024-04-03 01:30:42 -04:00
|
|
|
cherry-pick-options: -x
|
2024-03-23 04:39:23 -04:00
|
|
|
auth: ${{ secrets.BACKPORT_TOKEN }}
|
|
|
|
pull-request: ${{ github.event.pull_request.url }}
|
2024-04-11 04:15:38 -04:00
|
|
|
auto-no-squash: true
|
2024-04-15 12:23:57 -04:00
|
|
|
enable-err-notification: true
|
2024-07-31 11:43:36 -04:00
|
|
|
git-user: forgejo-backport-action
|
|
|
|
git-email: forgejo-backport-action@noreply.codeberg.org
|