[KYUUBI #320] Fix Merge PR with duplicated title

![yaooqinn](https://badgen.net/badge/Hello/yaooqinn/green) [![Closes%20#320](https://badgen.net/badge/Preview/Closes%2520%23320/blue)](https://github.com/yaooqinn/kyuubi/pull/320) ![1](https://badgen.net/badge/%2B/1/red) ![1](https://badgen.net/badge/-/1/green) ![1](https://badgen.net/badge/commits/1/yellow) [&#10088;?&#10089;](https://pullrequestbadge.com/?utm_medium=github&utm_source=yaooqinn&utm_campaign=badge_info)<!-- PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->

<!--
Thanks for sending a pull request!

Here are some tips for you:
  1. If this is your first time, please read our contributor guidelines:
     https://kyuubi.readthedocs.io/en/latest/community/contributions.html
-->
duplicated
### _Which issue are you going to fix?_
<!--
Replace ${ID} below with the actual issue id from
https://github.com/yaooqinn/kyuubi/issues,
so that the issue will be linked and automatically closed after merging
-->

Fixes #${ID}

### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
  1. If you add a feature, you can talk about the user case of it.
  2. If you fix a bug, you can clarify why it is a bug.
-->

duplicated PR ID in the merged title
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/tools/testing.html#running-tests) locally before make a pull request

Closes #320 from yaooqinn/mergepr2.

8cbcf1b [peterylh] Fix Merge PR with duplicated title

Authored-by: peterylh <peterylh@163.com>
Signed-off-by: Kent Yao <yao@apache.org>
This commit is contained in:
peterylh 2021-01-29 23:22:28 +08:00 committed by Kent Yao
parent a8b970133e
commit af58331f67
No known key found for this signature in database
GPG Key ID: F7051850A0AF904D

View File

@ -84,7 +84,7 @@ def clean_up():
run_cmd("git branch -D %s" % branch)
def fix_title(text, num):
if (re.search(r'^\[KYUUBI #[0-9]{3,6}\](\[[A-Z0-9_\s,]+\] )+\S+', text)):
if (re.search(r'^\[KYUUBI\s#[0-9]{3,6}\].*', text)):
return text
return '[KYUUBI #%s] %s' % (num, text)