0
0
Fork 0
mirror of https://codeberg.org/forgejo/docs.git synced 2025-02-01 03:35:03 -05:00

ci: fix after merge backporting, use actions/git-backporting

close #1042
This commit is contained in:
Robert Wolff 2025-01-19 20:06:28 +01:00
parent bef5a1a025
commit 02402ce1c2

View file

@ -7,26 +7,29 @@ on:
- 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.
backporting:
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
&&
contains(toJSON(github.event.pull_request.labels), 'backport/v')
runs-on: docker
container:
image: 'data.forgejo.org/oci/node:20-bookworm'
steps:
- name: send backport if the label "backport {branch}" is present
if: secrets.WEBSITETOKEN != ''
uses: https://github.com/tibdex/backport@v2
- name: event info
run: |
cat <<'EOF'
${{ toJSON(github) }}
EOF
- uses: https://data.forgejo.org/actions/git-backporting@v4.8.4
with:
github_token: ${{ secrets.WEBSITETOKEN }}
head_template: 'backport/<%= base %>/pr-<%= number %>'
label_pattern: '^backport/(?<base>([^ ]+))$'
target-branch-pattern: '^backport/(?<target>(v.*))$'
strategy: ort
strategy-option: find-renames
cherry-pick-options: -x
auth: ${{ secrets.WEBSITETOKEN }}
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