mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +01:00
Labeller action can remove labels from PR upon sync (#96131)
## About The Pull Request #92553 made it possible for the PR author to add labels to the PR body whenever it was updated however as discussed in the comments it was not possible to remove labels. Maintainers can still add/remove labels and that works as expected but the PR author could not. This obviously is inconvenient and should not be the case but now it is possible. This will not conflict with maintainer added/removed labels which means if the author says like removes the balance label from their changelog, but the maintainer adds the balance label then the balance label will always stay and cannot be removed by the author so labelling still works as intended. It will only remove labels added by the contributor should they decide to change their changelog/modified files/PR title at any point ## Changelog N/A --------- Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
@@ -177,12 +177,11 @@ export async function get_updated_label_set({ github, context }) {
|
||||
const {
|
||||
body = "",
|
||||
diff_url,
|
||||
labels = [],
|
||||
mergeable,
|
||||
title = "",
|
||||
} = pull_request;
|
||||
|
||||
const updated_labels = new Set(labels.map((l) => l.name));
|
||||
const updated_labels = new Set();
|
||||
|
||||
// Always check file diffs
|
||||
if (diff_url) {
|
||||
@@ -224,6 +223,9 @@ export async function get_updated_label_set({ github, context }) {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching paginated events:", error);
|
||||
for(const label of pull_request.labels){
|
||||
updated_labels.add(label.name);
|
||||
}
|
||||
}
|
||||
|
||||
// Always remove Test Merge Candidate
|
||||
|
||||
Reference in New Issue
Block a user