diff --git a/src/entrypoint.ts b/src/entrypoint.ts index fc476fe..249d2c5 100644 --- a/src/entrypoint.ts +++ b/src/entrypoint.ts @@ -1,5 +1,6 @@ import * as core from '@actions/core'; -import { getAndValidateInputs } from './input'; +import { getIssues, processIssues } from './github'; +import { allInterestedLabels, getAndValidateInputs } from './input'; /* Step 1: Grab the action inputs @@ -13,6 +14,8 @@ Step 4: Apply labels according to the mapping async function run() { try { const args = getAndValidateInputs(); + const issues = await getIssues(allInterestedLabels(args), args.token); + await processIssues(issues, args); } catch (e) { if (e instanceof Error) { core.setFailed(e.message); diff --git a/src/input.ts b/src/input.ts index 4be0086..2f5f0f9 100644 --- a/src/input.ts +++ b/src/input.ts @@ -42,3 +42,12 @@ export function getAndValidateInputs(): args { prUpdateRemoveLabels, }; } + +export function allInterestedLabels(args: args) { + return [ + ...(args.expirationLabelMap || []), + ...(args.updateRemoveLabels || []), + ...(args.prExpirationLabelMap || []), + ...(args.prUpdateRemoveLabels || []), + ]; +}