Skip to content

Commit

Permalink
get actor
Browse files Browse the repository at this point in the history
  • Loading branch information
tillydray committed Dec 8, 2022
1 parent e86574e commit 6723a55
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/labeler.ts
Expand Up @@ -22,12 +22,13 @@ export async function run() {
console.log("Could not get pull request number from context, exiting");
return;
}
const actor = getActor();
/* TODO
*
* [Assigns labels based on branch names](https://github.com/actions/labeler/pull/203/files)
* [Assign label based on status](https://github.com/actions/labeler/pull/79/files)
*
* - [ ] if list is nonempty, get actor https://github.com/actions/toolkit/blob/main/packages/github/src/context.ts#L17
* - [x] get actor https://github.com/actions/toolkit/blob/main/packages/github/src/context.ts#L17
* - [ ] find actor in list of provided actors
* - [ ] if found, add label(s)
* - [ ] if not found, do nothing
Expand Down Expand Up @@ -81,6 +82,15 @@ function getPrNumber(): number | undefined {
return pullRequest.number;
}

function getActor(): string[] {
const actor = github.context.actor;
if (!actor) {
return undefined;
}

return actor;
}

async function getChangedFiles(
client: ClientType,
prNumber: number
Expand Down

0 comments on commit 6723a55

Please sign in to comment.