Skip to content

Commit

Permalink
add GitHub action to add non-main branch to PR title
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vrothberg committed Oct 25, 2020
1 parent 6fa6470 commit b26a108
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b26a108

Please sign in to comment.