mirror of
https://github.com/actions/labeler.git
synced 2025-12-10 11:41:56 +00:00
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 <maksimzhukov@github.com> Co-authored-by: IvanZosimov <ivanzosimov@github.com>
This commit is contained in:
4
dist/index.js
vendored
4
dist/index.js
vendored
@@ -81,6 +81,10 @@ function run() {
|
||||
}
|
||||
core.debug(`fetching changed files for pr #${prNumber}`);
|
||||
const changedFiles = yield getChangedFiles(client, prNumber);
|
||||
if (!changedFiles.length) {
|
||||
core.warning(`Pull request #${prNumber} has no changed files, skipping`);
|
||||
continue;
|
||||
}
|
||||
const labelGlobs = yield getLabelGlobs(client, configPath);
|
||||
const preexistingLabels = pullRequest.labels.map(l => l.name);
|
||||
const allLabels = new Set(preexistingLabels);
|
||||
|
||||
Reference in New Issue
Block a user