-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Early exit when no files are changed. #456
Conversation
The source of the error is here: Lines 202 to 214 in 5c75392
The loop on lines 205-210 does not execute and therefore the |
Rebased and updated to match new code style. As all changes were formatting, the |
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.
Updated and rebuilt. |
Hello @nathanhammond! Could you please tell me, how do you create an empty PR? The link you provided as a labeler failure leads to a pull request. If you could provide the link with the run in which labeler failed - that would help me investigate the issue. |
@AndreiLobanovich I didn't create the PR that failed and it has changed a lot since then. I did see the consequences of the failure. You can review the tests that I added to demonstrate the failure in the event there are no changed files. Two commits with a net result of zero changes would probably do it? (I wouldn't have filed this PR without having seen it fail once. 😜 I wouldn't have known to go look!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, @nathanhammond!
Thanks for your contribution and attention to details! I managed to reproduce the incorrect behavior. Could you please make a few minor changes?
Hi @nathanhammond , I hope this message finds you well. I wanted to check in and see how you're progressing with this PR. Please feel free to let me know if you need any assistance or if there's anything that you're unsure of. We greatly appreciate your contribution and are here to support you in any way we can. Thank you for your time and effort. |
Hello, @nathanhammond! Didn't hear from you for a while. Do you have some spare time to finish work on this PR? Is there anything I can help you with? |
Hey, @nathanhammond, we miss you a lot. If you could find some spare time to finish work on this PR that would be great. |
@nathanhammond thank you for the contribution! |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/labeler](https://github.com/actions/labeler) | action | minor | `v4.2.0` -> `v4.3.0` | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the logs for more information. --- ### Release Notes <details> <summary>actions/labeler (actions/labeler)</summary> ### [`v4.3.0`](https://github.com/actions/labeler/releases/tag/v4.3.0) [Compare Source](https://github.com/actions/labeler/compare/v4.2.0...v4.3.0) #### What's Changed In scope of this release, the ability to specify pull request number(s) was added by [@​credfeto](https://github.com/credfeto) in [https://github.com/actions/labeler/pull/349](https://github.com/actions/labeler/pull/349). Support for reading from the configuration file presented on the runner was added by [@​lrstanley](https://github.com/lrstanley) in [https://github.com/actions/labeler/pull/394](https://github.com/actions/labeler/pull/394). It allows you to use a configuration file generated during workflow run or uploaded from a separate repository. Please refer to the [action documentation](https://github.com/actions/labeler#inputs) for more information. This release also includes the following changes: - Improved Error message for missing config file by [@​Gornoka](https://github.com/Gornoka) in [https://github.com/actions/labeler/pull/475](https://github.com/actions/labeler/pull/475) - Early exit when no files are changed by [@​nathanhammond](https://github.com/nathanhammond) in [https://github.com/actions/labeler/pull/456](https://github.com/actions/labeler/pull/456) - Add examples to match all repo files by [@​MaksimZhukov](https://github.com/MaksimZhukov) in [https://github.com/actions/labeler/pull/600](https://github.com/actions/labeler/pull/600) - Fix a typo in the example about using the action outputs by [@​MaksimZhukov](https://github.com/MaksimZhukov) in [https://github.com/actions/labeler/pull/606](https://github.com/actions/labeler/pull/606) - Bump eslint from 8.43.0 to 8.44.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/actions/labeler/pull/601](https://github.com/actions/labeler/pull/601) - Bump [@​typescript-eslint/parser](https://github.com/typescript-eslint/parser) from 5.60.1 to 5.61.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/actions/labeler/pull/602](https://github.com/actions/labeler/pull/602) - Bump [@​typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin) from 5.60.1 to 5.61.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/actions/labeler/pull/604](https://github.com/actions/labeler/pull/604) - Bump tough-cookie from 4.1.2 to 4.1.3 by [@​dependabot](https://github.com/dependabot) in [https://github.com/actions/labeler/pull/609](https://github.com/actions/labeler/pull/609) - Bump [@​octokit/plugin-retry](https://github.com/octokit/plugin-retry) from 5.0.4 to 5.0.5 by [@​MaksimZhukov](https://github.com/MaksimZhukov) in [https://github.com/actions/labeler/pull/610](https://github.com/actions/labeler/pull/610) #### New Contributors - [@​credfeto](https://github.com/credfeto) made their first contribution in [https://github.com/actions/labeler/pull/349](https://github.com/actions/labeler/pull/349) - [@​lrstanley](https://github.com/lrstanley) made their first contribution in [https://github.com/actions/labeler/pull/394](https://github.com/actions/labeler/pull/394) - [@​nathanhammond](https://github.com/nathanhammond) made their first contribution in [https://github.com/actions/labeler/pull/456](https://github.com/actions/labeler/pull/456) **Full Changelog**: actions/labeler@v4...v4.3.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/owntracks/android). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41LjMiLCJ1cGRhdGVkSW5WZXIiOiIzNi41LjMiLCJ0YXJnZXRCcmFuY2giOiJtYXN0ZXIifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/labeler](https://github.com/actions/labeler) | action | minor | `v4.2.0` -> `v4.3.0` | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the logs for more information. --- ### Release Notes <details> <summary>actions/labeler (actions/labeler)</summary> ### [`v4.3.0`](https://github.com/actions/labeler/releases/tag/v4.3.0) [Compare Source](https://github.com/actions/labeler/compare/v4.2.0...v4.3.0) #### What's Changed In scope of this release, the ability to specify pull request number(s) was added by [@​credfeto](https://github.com/credfeto) in [https://github.com/actions/labeler/pull/349](https://github.com/actions/labeler/pull/349). Support for reading from the configuration file presented on the runner was added by [@​lrstanley](https://github.com/lrstanley) in [https://github.com/actions/labeler/pull/394](https://github.com/actions/labeler/pull/394). It allows you to use a configuration file generated during workflow run or uploaded from a separate repository. Please refer to the [action documentation](https://github.com/actions/labeler#inputs) for more information. This release also includes the following changes: - Improved Error message for missing config file by [@​Gornoka](https://github.com/Gornoka) in [https://github.com/actions/labeler/pull/475](https://github.com/actions/labeler/pull/475) - Early exit when no files are changed by [@​nathanhammond](https://github.com/nathanhammond) in [https://github.com/actions/labeler/pull/456](https://github.com/actions/labeler/pull/456) - Add examples to match all repo files by [@​MaksimZhukov](https://github.com/MaksimZhukov) in [https://github.com/actions/labeler/pull/600](https://github.com/actions/labeler/pull/600) - Fix a typo in the example about using the action outputs by [@​MaksimZhukov](https://github.com/MaksimZhukov) in [https://github.com/actions/labeler/pull/606](https://github.com/actions/labeler/pull/606) - Bump eslint from 8.43.0 to 8.44.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/actions/labeler/pull/601](https://github.com/actions/labeler/pull/601) - Bump [@​typescript-eslint/parser](https://github.com/typescript-eslint/parser) from 5.60.1 to 5.61.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/actions/labeler/pull/602](https://github.com/actions/labeler/pull/602) - Bump [@​typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin) from 5.60.1 to 5.61.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/actions/labeler/pull/604](https://github.com/actions/labeler/pull/604) - Bump tough-cookie from 4.1.2 to 4.1.3 by [@​dependabot](https://github.com/dependabot) in [https://github.com/actions/labeler/pull/609](https://github.com/actions/labeler/pull/609) - Bump [@​octokit/plugin-retry](https://github.com/octokit/plugin-retry) from 5.0.4 to 5.0.5 by [@​MaksimZhukov](https://github.com/MaksimZhukov) in [https://github.com/actions/labeler/pull/610](https://github.com/actions/labeler/pull/610) #### New Contributors - [@​credfeto](https://github.com/credfeto) made their first contribution in [https://github.com/actions/labeler/pull/349](https://github.com/actions/labeler/pull/349) - [@​lrstanley](https://github.com/lrstanley) made their first contribution in [https://github.com/actions/labeler/pull/394](https://github.com/actions/labeler/pull/394) - [@​nathanhammond](https://github.com/nathanhammond) made their first contribution in [https://github.com/actions/labeler/pull/456](https://github.com/actions/labeler/pull/456) **Full Changelog**: actions/labeler@v4...v4.3.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/owntracks/android). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41LjMiLCJ1cGRhdGVkSW5WZXIiOiIzNi41LjMiLCJ0YXJnZXRCcmFuY2giOiJtYXN0ZXIifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/labeler](https://github.com/actions/labeler) | action | minor | `v4.2.0` -> `v4.3.0` | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the logs for more information. --- ### Release Notes <details> <summary>actions/labeler (actions/labeler)</summary> ### [`v4.3.0`](https://github.com/actions/labeler/releases/tag/v4.3.0) [Compare Source](https://github.com/actions/labeler/compare/v4.2.0...v4.3.0) #### What's Changed In scope of this release, the ability to specify pull request number(s) was added by [@​credfeto](https://github.com/credfeto) in [https://github.com/actions/labeler/pull/349](https://github.com/actions/labeler/pull/349). Support for reading from the configuration file presented on the runner was added by [@​lrstanley](https://github.com/lrstanley) in [https://github.com/actions/labeler/pull/394](https://github.com/actions/labeler/pull/394). It allows you to use a configuration file generated during workflow run or uploaded from a separate repository. Please refer to the [action documentation](https://github.com/actions/labeler#inputs) for more information. This release also includes the following changes: - Improved Error message for missing config file by [@​Gornoka](https://github.com/Gornoka) in [https://github.com/actions/labeler/pull/475](https://github.com/actions/labeler/pull/475) - Early exit when no files are changed by [@​nathanhammond](https://github.com/nathanhammond) in [https://github.com/actions/labeler/pull/456](https://github.com/actions/labeler/pull/456) - Add examples to match all repo files by [@​MaksimZhukov](https://github.com/MaksimZhukov) in [https://github.com/actions/labeler/pull/600](https://github.com/actions/labeler/pull/600) - Fix a typo in the example about using the action outputs by [@​MaksimZhukov](https://github.com/MaksimZhukov) in [https://github.com/actions/labeler/pull/606](https://github.com/actions/labeler/pull/606) - Bump eslint from 8.43.0 to 8.44.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/actions/labeler/pull/601](https://github.com/actions/labeler/pull/601) - Bump [@​typescript-eslint/parser](https://github.com/typescript-eslint/parser) from 5.60.1 to 5.61.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/actions/labeler/pull/602](https://github.com/actions/labeler/pull/602) - Bump [@​typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin) from 5.60.1 to 5.61.0 by [@​dependabot](https://github.com/dependabot) in [https://github.com/actions/labeler/pull/604](https://github.com/actions/labeler/pull/604) - Bump tough-cookie from 4.1.2 to 4.1.3 by [@​dependabot](https://github.com/dependabot) in [https://github.com/actions/labeler/pull/609](https://github.com/actions/labeler/pull/609) - Bump [@​octokit/plugin-retry](https://github.com/octokit/plugin-retry) from 5.0.4 to 5.0.5 by [@​MaksimZhukov](https://github.com/MaksimZhukov) in [https://github.com/actions/labeler/pull/610](https://github.com/actions/labeler/pull/610) #### New Contributors - [@​credfeto](https://github.com/credfeto) made their first contribution in [https://github.com/actions/labeler/pull/349](https://github.com/actions/labeler/pull/349) - [@​lrstanley](https://github.com/lrstanley) made their first contribution in [https://github.com/actions/labeler/pull/394](https://github.com/actions/labeler/pull/394) - [@​nathanhammond](https://github.com/nathanhammond) made their first contribution in [https://github.com/actions/labeler/pull/456](https://github.com/actions/labeler/pull/456) **Full Changelog**: actions/labeler@v4...v4.3.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/owntracks/android). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41LjMiLCJ1cGRhdGVkSW5WZXIiOiIzNi41LjMiLCJ0YXJnZXRCcmFuY2giOiJtYXN0ZXIifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
As a consequence of the
checkAll
function call returningtrue
if the length ofchangedFiles
is 0, this must early-exit in order to avoid labeling empty PRs.Example labeling failure here: vercel/turborepo#2706