File tree Expand file tree Collapse file tree 2 files changed +0
-8
lines changed Expand file tree Collapse file tree 2 files changed +0
-8
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,6 @@ export default class GitHub {
65
65
const updatedExistingLabels = labelsToRemove . length ? await this . getRepositoryLabels ( ) : existingLabels ; // Refresh labels after deletion, only if needed
66
66
const managedLabelsNames = this . MANAGED_LABELS . map ( label => label . name ) ;
67
67
68
- // Remove managed labels that are no longer in the MANAGED_LABELS list
69
68
const obsoleteManagedLabels = updatedExistingLabels . filter ( label =>
70
69
label . description
71
70
&& label . description . includes ( MANAGED_BY_OTA_MARKER )
@@ -79,12 +78,10 @@ export default class GitHub {
79
78
}
80
79
}
81
80
82
- // Refresh labels after obsolete removal
83
81
const finalExistingLabels = obsoleteManagedLabels . length ? await this . getRepositoryLabels ( ) : updatedExistingLabels ;
84
82
const existingLabelsNames = finalExistingLabels . map ( label => label . name ) ;
85
83
const existingLabelsMap = new Map ( finalExistingLabels . map ( label => [ label . name , label ] ) ) ;
86
84
87
- // Find labels that need to be created
88
85
const missingLabels = this . MANAGED_LABELS . filter ( label => ! existingLabelsNames . includes ( label . name ) ) ;
89
86
90
87
if ( missingLabels . length ) {
@@ -99,7 +96,6 @@ export default class GitHub {
99
96
}
100
97
}
101
98
102
- // Update existing labels if description changed
103
99
const labelsToUpdate = this . MANAGED_LABELS . filter ( label => {
104
100
const existingLabel = existingLabelsMap . get ( label . name ) ;
105
101
Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ export default class GitLab {
59
59
const updatedExistingLabels = labelsToRemove . length ? await this . getRepositoryLabels ( ) : existingLabels ; // Refresh labels after deletion, only if needed
60
60
const managedLabelsNames = this . MANAGED_LABELS . map ( label => label . name ) ;
61
61
62
- // Remove managed labels that are no longer in the MANAGED_LABELS list
63
62
const obsoleteManagedLabels = updatedExistingLabels . filter ( label =>
64
63
label . description
65
64
&& label . description . includes ( MANAGED_BY_OTA_MARKER )
@@ -73,12 +72,10 @@ export default class GitLab {
73
72
}
74
73
}
75
74
76
- // Refresh labels after obsolete removal
77
75
const finalExistingLabels = obsoleteManagedLabels . length ? await this . getRepositoryLabels ( ) : updatedExistingLabels ;
78
76
const existingLabelsNames = finalExistingLabels . map ( label => label . name ) ;
79
77
const existingLabelsMap = new Map ( finalExistingLabels . map ( label => [ label . name , label ] ) ) ;
80
78
81
- // Find labels that need to be created
82
79
const missingLabels = this . MANAGED_LABELS . filter ( label => ! existingLabelsNames . includes ( label . name ) ) ;
83
80
84
81
if ( missingLabels . length ) {
@@ -93,7 +90,6 @@ export default class GitLab {
93
90
}
94
91
}
95
92
96
- // Update existing labels if description or color changed
97
93
const labelsToUpdate = this . MANAGED_LABELS . filter ( label => {
98
94
const existingLabel = existingLabelsMap . get ( label . name ) ;
99
95
You can’t perform that action at this time.
0 commit comments