Previously the label was not added if the backport PR was created
manually. The new code is also easier to maintain as it's close to other
label-related code.
Github doesn't allow workflows to be run from the `github-actions`
account, which is the default account. This caused the CI on backport
PRs to not be run. The way to circumvent this is to use a token that
essentially "pretends" to be another user, which in turn triggers the CI
as desired.
Also run lintcommit on release branches as that is now a required check,
meaning it must always be run.
`[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.
Problem: Commits backport-merged to release branches are cherry-picked
from the original commits in the PR from a fork repository, NOT the
actual commit that are merged to neovim/neovim (HEAD). Therefore the
commit reference in the commit message `cherry picked from commit ...`
usually refers to a commit that does NOT exist in the repository,
given that our preferred way of merging PR (rebasing, squashing, etc.)
would rewrite commits.
Solution: Turn on new feature 'detect_merge_method' of backport-action
workflow.
Trigger the backport action upon merge by marking a PR with the label `backport <branchname>` or after merge by applying the label and writing a comment containing `/backport`.