From b26a1085cd291de25950cfe6f5221d7499d7669a Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Sun, 25 Oct 2020 11:30:21 +0100 Subject: add GitHub action to add non-main branch to PR title Add a GitHub action to add the name of the target branch as prefix to the title of a pull request. It is easy to miss the target of a given pull request which has already caused issues of commits going into non-main branches without intention. We have already used this action on the `v2.0.5-rhel` branch with limited success. Fortunately, the upstream implemented our feature request to support adding the _target_ branch name (rather than the source) to the PR title, which is what we need. Any non-main branch from this commit forward will now be clearly marked. Signed-off-by: Valentin Rothberg --- .github/workflows/pr-title.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/pr-title.yml (limited to '.github') diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 000000000..0709fb5f0 --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,16 @@ +# Upstream: github.com/tzkhan/pr-update-action + +name: "PR title check" + +on: pull_request_target + +jobs: + update_pr: + runs-on: ubuntu-latest + steps: + - uses: tzkhan/pr-update-action@v2 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + base-branch-regex: '^(?!master).*$' + title-template: '[%basebranch%]' + title-prefix-space: true -- cgit v1.2.3-54-g00ecf