File tree 2 files changed +13
-3
lines changed
pr-conventional-to-toptal-commits
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' davinci-github-actions ' : patch
3
+ ---
4
+
5
+ - add safeguard to not send empty title to github api
Original file line number Diff line number Diff line change @@ -21,16 +21,21 @@ runs:
21
21
const pattern = /^\w+(?:\(.+\))?: (.*)$/
22
22
const [, titleMessage = ''] = title.match(pattern) ?? []
23
23
24
- return capitalize(titleMessage.trim()) ?? title
24
+ return capitalize(titleMessage.trim()) || title
25
25
}
26
26
27
+ const oldTitle = context.payload.pull_request.title
28
+ const updatedTitle = convertConventional(oldTitle)
29
+
27
30
const newPr = {
28
31
owner: context.repo.owner,
29
32
repo: context.repo.repo,
30
33
pull_number: context.payload.pull_request.number,
31
- title: convertConventional(context.payload.pull_request.title)
34
+ title: updatedTitle,
32
35
}
33
36
34
- github.rest.pulls.update(newPr);
37
+ if (oldTitle !== updatedTitle) {
38
+ github.rest.pulls.update(newPr);
39
+ }
35
40
36
41
You can’t perform that action at this time.
0 commit comments