You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to only add label, not remove when PR is opened?Β #112
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 apply Docs and coordinates.
However, the PR author already manually applied Docs label at creation time. As a result, the labeler ended up removing the Docs 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!
Reacted by Jakub Kuczys, Maria Kotliarevskaia, Alec Hartung, Franklin Rakotomalala, Vlad Ionescu, Jeff Huang, Adam Azarchs, Bane Sullivan, Ashhar Hasan, sensuikan1973 and 6 more
Strangely enough, accidental removal did not happen for astropy/astropy#11028 when the file changed was only docs/conf.py and Docs label was also applied manually when PR was opened.
(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.
By removing the manually attached tags, the benefits gained by labelar are diminished.
Reacted by Maria Kotliarevskaia, Vlad Ionescu, Jeff Huang, Corey Kreiniker, Nico Neumann and Mathias Holst Gundersen
This still may happen with v5 action if the labels are added by the user at the time that's very close to the action run:
User added labels at 2024-07-19T15:07:34Z. Bot added his own at 2024-07-19T15:07:35Z.
And bot started running at 2024-07-19T15:07:34Z as per GH action logs. So my guess is that it read labels, then user added his labels, then bot applied the rules and has overridden some of the labels the user has previously added.
Activity
pllim commentedon Nov 11, 2020
Strangely enough, accidental removal did not happen for astropy/astropy#11028 when the file changed was only
docs/conf.pyandDocslabel was also applied manually when PR was opened.(The Action ran successfully but it was a no-op, as expected.)
makecir commentedon Feb 2, 2021
There hasn't been much progress in the conversation, but I also want to solve this problem.
By removing the manually attached tags, the benefits gained by labelar are diminished.
ericdallo commentedon Mar 16, 2021
Any news here?
adam-azarchs commentedon Dec 23, 2021
It looks like the problem is
labeler/src/labeler.ts
Line 18 in 5906282
which is not correct because the default value is
"false", and!!"false" == true.adam-azarchs commentedon Dec 23, 2021
Confirmed, you can work around this bug by setting
in your workflow.
GH Action - Fix the labeler about existing labels
Fix the GH Action labeler to not remove labels
liverpool1026 commentedon May 24, 2022
Thanks for this, can also confirm this works in v4. Any plans to fix this properly in the next version?
fix: correct reading of sync-labels input.
fix: correct reading of sync-labels input.
fix: correct reading of sync-labels input.
ci: prevent label remove
ci: prevent label remove (#69)
fix: correct reading of sync-labels input. (#480)
[labeler] Mark sync-labels as empty
[labeler] Mark sync-labels as empty (#130642)
[labeler] Mark sync-labels as empty (flutter#130642)
Fix labeler configuration (#6344)
Update sync-labels to use boolean (#139516)
Reverts "Update sync-labels to use boolean" (#139533)
Fix labeler workflow
patch github action labeler - leave manual labels (https://github.comβ¦
xSAVIKx commentedon Jul 19, 2024
This still may happen with v5 action if the labels are added by the user at the time that's very close to the action run:

User added labels at
2024-07-19T15:07:34Z. Bot added his own at2024-07-19T15:07:35Z.And bot started running at
2024-07-19T15:07:34Zas per GH action logs. So my guess is that it read labels, then user added his labels, then bot applied the rules and has overridden some of the labels the user has previously added.WF config:
Related rules:
patch labeler action