tzkhan / pr-update-action

GitHub Action that updates a pull request with information extracted from branch name

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Branch changing case sensitive

ivanbanov opened this issue · comments

Hey I have the following config

on:
  pull_request:
    types: [opened]

name: Set JIRA ticket
jobs:
  update_pr:
    runs-on: ubuntu-latest
    steps:
      - uses: tzkhan/pr-update-action@v1
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          branch-regex: '[A-Z]+-[0-9]+|no-ticket'
          lowercase-branch: false
          title-template: '[%branch%] '
          uppercase-title: false
          body-template: "### JIRA: [%branch%](https://company-xyz.atlassian.net/browse/%branch%)"
          uppercase-body: false

the expected behavior is
branches using no-ticket such as feat/no-ticket/foo should have the title

[no-ticket] Description foo

and for branch using feat/QUX-123/bar should have the title

[QUX-123] Description bar

but it's not working at all, the no-ticket case is always using uppercase
and regular expression for the QUX-123 only works if I consider lowercase [a-z]+-[0-9]+|no-ticket

is it actually a bug?

@ivanbanov Well spotted and thanks again for the pull request. This will still be broken on v1. In the meantime, please reference - uses: tzkhan/pr-update-action@master in the workflow yaml.

Updated v1 so - uses: tzkhan/pr-update-action@v1 should work.

@tzkhan btw, seems like the PR didnt fix the problem

@ivanbanov try now, should hopefully work.

I checked against a test repo and it works fine. I've also added a couple more config fields to allow more control around the spacing after the prefix texts and also added some screenshots 🙂

@tzkhan Just tested it again and now it's working just like the expected, thank you very much for the really quick fix! 💯