Skip to content

Commit 552fd83

Browse files
committed
chore: update labels in scripts
1 parent fa68ba1 commit 552fd83

File tree

3 files changed

+14
-26
lines changed

3 files changed

+14
-26
lines changed

.github/scripts/constants.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ module.exports = Object.freeze({
2525
"LABEL_BLOCK_REASON": "need-issue",
2626

2727
/** @type {string} */
28-
"LABEL_PENDING_RELEASE": "pending-release",
28+
"LABEL_PENDING_RELEASE": "status/pending-release",
29+
30+
/** @type {string} */
31+
"LABEL_RELEASED": "status/completed",
2932

3033
/** @type {string} */
3134
"HANDLE_MAINTAINERS_TEAM": "@awslabs/aws-lambda-powertools-typescript",

.github/scripts/label_pr_based_on_title.js

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
const { PR_NUMBER, PR_TITLE, AREAS } = require("./constants");
1+
const { PR_NUMBER, PR_TITLE } = require("./constants");
22

33
module.exports = async ({github, context, core}) => {
4-
const FEAT_REGEX = /feat(\((.+)\))?(:.+)/
54
const BUG_REGEX = /(fix|bug)(\((.+)\))?(:.+)/
5+
const FEAT_REFACTOR_REGEX = /(feat|refactor)(\((.+)\))?(:.+)/
66
const DOCS_REGEX = /(docs|doc)(\((.+)\))?(:.+)/
77
const CHORE_REGEX = /(chore)(\((.+)\))?(:.+)/
88
const DEPRECATED_REGEX = /(deprecated)(\((.+)\))?(:.+)/
9-
const REFACTOR_REGEX = /(refactor)(\((.+)\))?(:.+)/
10-
9+
1110
const labels = {
12-
"feature": FEAT_REGEX,
13-
"bug": BUG_REGEX,
14-
"documentation": DOCS_REGEX,
15-
"internal": CHORE_REGEX,
16-
"enhancement": REFACTOR_REGEX,
17-
"deprecated": DEPRECATED_REGEX,
18-
};
11+
"type/feature": FEAT_REFACTOR_REGEX,
12+
"type/bug": BUG_REGEX,
13+
"area/documentation": DOCS_REGEX,
14+
"type/internal": CHORE_REGEX,
15+
"type/deprecation": DEPRECATED_REGEX,
16+
}
1917

2018
// Maintenance: We should keep track of modified PRs in case their titles change
2119
let miss = 0;
@@ -33,19 +31,6 @@ module.exports = async ({github, context, core}) => {
3331
labels: [label]
3432
});
3533

36-
const area = matches[2]; // second capture group contains the area
37-
if (AREAS.indexOf(area) > -1) {
38-
core.info(`Auto-labeling PR ${PR_NUMBER} with area ${area}`);
39-
await github.rest.issues.addLabels({
40-
issue_number: PR_NUMBER,
41-
owner: context.repo.owner,
42-
repo: context.repo.repo,
43-
labels: [`area/${area}`],
44-
});
45-
} else {
46-
core.debug(`'${PR_TITLE}' didn't match any known area.`);
47-
}
48-
4934
return;
5035
} else {
5136
core.debug(`'${PR_TITLE}' didn't match '${label}' semantic.`);

.github/scripts/label_related_issue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const {
66
LABEL_PENDING_RELEASE,
77
HANDLE_MAINTAINERS_TEAM,
88
PR_IS_MERGED,
9-
} = require("./constants")
9+
} = require("./constants");
1010

1111
module.exports = async ({github, context, core}) => {
1212
if (IGNORE_AUTHORS.includes(PR_AUTHOR)) {

0 commit comments

Comments
 (0)