Home

Awesome

Pull Request Updater

Update Pull Request Release

This is a GitHub Action that updates a pull request with information extracted from branch name. The branch could be either base or head branch or both. The pull request title and body can either be prefixed, suffixed or replaced.

Usage

Create a workflow yaml file (for e.g. .github/workflows/update-pr.yml). See Creating a Workflow file.

Inputs

Required

Optional

Notes:

Outputs

Example

So the following yaml

name: "Update Pull Request"
on: pull_request

jobs:
  update_pr:
    runs-on: ubuntu-latest
    steps:
    - uses: tzkhan/pr-update-action@v2
      with:
        repo-token: "${{ secrets.GITHUB_TOKEN }}"
        base-branch-regex: '[a-z\d-_.\\/]+'
        head-branch-regex: 'foo-\d+'
        title-template: '[%headbranch%] '
        body-template: |
          Merging into '%basebranch%'
          [Link to %headbranch%](https://url/to/browse/ticket/%headbranch%)
        body-update-action: 'suffix'
        body-uppercase-base-match: false

produces this effect... :point_down:

before:

pr before

after:

pr after