neovim/.github/workflows/backport.yml
dundargoc 631d5189ad ci: improve default backport pull request title
`[Backport release-x.y]` will no longer be part of the pull request
title. This means the PR titles will go from looking like

```
[Backport release-0.9] fix(languagetree): remove double recursion in LanguageTree:parse
```

to

```
fix(languagetree): remove double recursion in LanguageTree:parse
```

The benefit of this is that pull requests merged with the "Squash and
Merge" strategy (which uses the PR title as the commit message), will
still follow the conventional commits specification. This will help
tools that rely on conventional commits such as git-cliff.

The `backport` label is added to backported PRs to help distinguish
between backport PRs with regular PRs in the "Pull Requests" tab on
github.

To reduce confusion with the `backport` label, the label to trigger the
backporting has been changed from `backport release-x.y` to
`ci:backport release-x.y`. This is also more consistent with other
labels that trigger a CI job which all use the `ci:` prefix.
2024-05-01 22:30:17 +02:00

36 lines
983 B
YAML

name: backport
on:
pull_request_target:
types: [closed, labeled]
jobs:
backport:
permissions:
contents: write
pull-requests: write
name: Backport Pull Request
if: github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create backport PR
id: backport
uses: korthout/backport-action@v2
with:
pull_title: "${pull_title}"
label_pattern: "^ci:backport ([^ ]+)$"
# https://github.com/korthout/backport-action/pull/399
experimental: >
{
"detect_merge_method": true
}
- uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
issue_number: ${{steps.backport.outputs.created_pull_numbers}},
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['backport']
})