-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathcheck-pr-title.js
More file actions
41 lines (39 loc) · 908 Bytes
/
check-pr-title.js
File metadata and controls
41 lines (39 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import {
DEFAULT_PR_TITLE_REGEX
} from "../main-9c2herm2.js";
import {
HelperInputs
} from "../main-8h70j5cy.js";
import {
octokit
} from "../main-4c5nddsb.js";
import {
context
} from "../main-6avxv4a6.js";
import"../main-9m3k9gt0.js";
import {
setFailed
} from "../main-q70tmm6g.js";
import"../main-wckvcay0.js";
// src/helpers/check-pr-title.ts
class CheckPrTitle extends HelperInputs {
}
var checkPrTitle = async ({ pattern = DEFAULT_PR_TITLE_REGEX }) => {
const regex = new RegExp(pattern);
const {
data: { title }
} = await octokit.pulls.get({
pull_number: context.issue.number,
...context.repo
});
if (regex.test(title)) {
return true;
}
setFailed(`Pull request title does not meet requirements. The title must match the following regex: ${pattern}`);
return false;
};
export {
checkPrTitle,
CheckPrTitle
};
//# debugId=C2025280B7E6F40964756E2164756E21