Skip to content

Commit 35061ab

Browse files
committed
add PR support
1 parent aa3cf88 commit 35061ab

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/entrypoint.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as core from '@actions/core';
2-
import { getAndValidateInputs } from './input';
2+
import { getIssues, processIssues } from './github';
3+
import { allInterestedLabels, getAndValidateInputs } from './input';
34

45
/*
56
Step 1: Grab the action inputs
@@ -13,6 +14,8 @@ Step 4: Apply labels according to the mapping
1314
async function run() {
1415
try {
1516
const args = getAndValidateInputs();
17+
const issues = await getIssues(allInterestedLabels(args), args.token);
18+
await processIssues(issues, args);
1619
} catch (e) {
1720
if (e instanceof Error) {
1821
core.setFailed(e.message);

src/input.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,12 @@ export function getAndValidateInputs(): args {
4242
prUpdateRemoveLabels,
4343
};
4444
}
45+
46+
export function allInterestedLabels(args: args) {
47+
return [
48+
...(args.expirationLabelMap || []),
49+
...(args.updateRemoveLabels || []),
50+
...(args.prExpirationLabelMap || []),
51+
...(args.prUpdateRemoveLabels || []),
52+
];
53+
}

0 commit comments

Comments
 (0)