Early exit when no files are changed. (#456)
* Early exit when no files are changed. As a consequence of the `checkAll` function call returning `true` if the length of `changedFiles` is 0, this must early-exit in order to avoid labeling empty PRs. * Update dist. * Update for new code styles. * review changes requested * Update dist. * chore: prettify code --------- Co-authored-by: MaksimZhukov <[email protected]> Co-authored-by: IvanZosimov <[email protected]>
This commit is contained in:
co-authored by
MaksimZhukov
IvanZosimov
parent
994304c5d5
commit
be13bbd1b7
@@ -48,6 +48,13 @@ export async function run() {
|
||||
|
||||
core.debug(`fetching changed files for pr #${prNumber}`);
|
||||
const changedFiles: string[] = await getChangedFiles(client, prNumber);
|
||||
if (!changedFiles.length) {
|
||||
core.warning(
|
||||
`Pull request #${prNumber} has no changed files, skipping`
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
const labelGlobs: Map<string, StringOrMatchConfig[]> =
|
||||
await getLabelGlobs(client, configPath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user