Skip to content

Commit 467f00e

Browse files
refactor: title assignment (#10)
1 parent db7ee0b commit 467f00e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ const github = require('@actions/github');
44
try {
55
const issuekey = core.getInput('issuekey').toLowerCase().replace(/ /g, '')
66
const keyarr = issuekey.split(',')
7+
if (github.context.payload && github.context.payload.pull_request) {
8+
var title = github.context.payload.pull_request.title
9+
title = title.toLowerCase()
10+
}
11+
core.info(title)
712
var passed = false
813
for (let i = 0; i < keyarr.length; i++) {
914
const pattern = '^(build|ci|chore|docs|feat|fix|perf|refactor|revert|style|task|test)(.*)(:\\s)(' + keyarr[i] + '-\\d+\\s*|none)+(:)'
1015
const regex = new RegExp(pattern)
11-
if (github.context.payload && github.context.payload.pull_request) {
12-
var title = github.context.payload.pull_request.title
13-
title = title.toLowerCase()
14-
}
15-
core.info(title)
1616
if (regex.test(title)) {
1717
passed = true
1818
}

0 commit comments

Comments
 (0)