-
Notifications
You must be signed in to change notification settings - Fork 419
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
How to only add label, not remove when PR is opened? #112
Comments
Strangely enough, accidental removal did not happen for astropy/astropy#11028 when the file changed was only (The Action ran successfully but it was a no-op, as expected.) |
There hasn't been much progress in the conversation, but I also want to solve this problem. |
Any news here? |
It looks like the problem is Line 18 in 5906282
which is not correct because the default value is "false" , and !!"false" == true .
|
Confirmed, you can work around this bug by setting sync-labels: '' in your workflow. |
Thanks for this, can also confirm this works in v4. Any plans to fix this properly in the next version? |
Contrary to the assumptions made in the unit tests, core.getInput always returns a string, and !!'false' is true. Also updates the unit test to reduce changes of regressions by ensuring that the mocked getInput returns a string, as it would in production. Fixes actions#112 Make sure test catches regressions.
This prevents the removal of labels that occurs due to a bug in 'actions/labeler' (see actions/labeler#112).
This prevents the removal of labels that occurs due to a bug in 'actions/labeler' (see actions/labeler#112).
* fix: correct reading of sync-labels input. Contrary to the assumptions made in the unit tests, core.getInput always returns a string, and !!'false' is true. Also updates the unit test to reduce changes of regressions by ensuring that the mocked getInput returns a string, as it would in production. Fixes #112 Make sure test catches regressions. * Rebuild dist/index.js.
#128440 Recommendation from actions/labeler#112 (comment)
# Description In PR #6328 I have added an automatic maintenance label when something is edited pre-commit. But I wrongly understand actions/lableler documentation and thought that the bug was fixed, that is true, but it is fixed in v5 branch, not backported to v4. v5 has been from a long time (since May) in the release process. actions/labeler#112
actions/labeler#112 has been fixed, and now requires boolean to be used. Related infra issue that this fixes: #139511
Reverts #139516 Initiated by: godofredoc This change reverts the following previous change: Original Description: actions/labeler#112 has been fixed, and now requires boolean to be used. Related infra issue that this fixes: #139511
I have a labeler action set up for when PR is opened, using all your default settings. The labeler YAML is set up as such (relevant parts listed below):
When astropy/astropy#11023 was opened, the only file changed was
docs/coordinates/apply_space_motion.rst
. By the labeler logic, it should applyDocs
andcoordinates
.However, the PR author already manually applied
Docs
label at creation time. As a result, the labeler ended up removing theDocs
label. Is this a bug? How do I tell it to simply no-op when a label that should be applied is already there?Hope you can help and thanks for such a useful action!
The text was updated successfully, but these errors were encountered: