File tree 2 files changed +0
-30
lines changed
github-actions/commit-message-based-labels
2 files changed +0
-30
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,6 @@ class CommitMessageBasedLabelManager {
49
49
if ( hasCommit && ! hasLabel ) {
50
50
await this . addLabel ( name ) ;
51
51
}
52
- if ( ! hasCommit && hasLabel ) {
53
- await this . removeLabel ( name ) ;
54
- }
55
52
}
56
53
57
54
for ( const commit of this . commits ) {
@@ -78,19 +75,6 @@ class CommitMessageBasedLabelManager {
78
75
}
79
76
}
80
77
81
- /** Remove the provided label from the pull request. */
82
- async removeLabel ( name : string ) {
83
- const { number : issue_number , owner, repo} = context . issue ;
84
- try {
85
- await this . git . issues . removeLabel ( { repo, owner, issue_number, name} ) ;
86
- core . info ( `Added ${ name } label to PR #${ issue_number } ` ) ;
87
- this . labels . delete ( name ) ;
88
- } catch ( err ) {
89
- core . error ( `Failed to add ${ name } label to PR #${ issue_number } ` ) ;
90
- core . debug ( err as string ) ;
91
- }
92
- }
93
-
94
78
/** Initialize the current labels and commits for the PR. */
95
79
async initialize ( ) {
96
80
const { number, owner, repo} = context . issue ;
Original file line number Diff line number Diff line change @@ -43655,9 +43655,6 @@ var CommitMessageBasedLabelManager = class {
43655
43655
if (hasCommit && !hasLabel) {
43656
43656
await this.addLabel(name);
43657
43657
}
43658
- if (!hasCommit && hasLabel) {
43659
- await this.removeLabel(name);
43660
- }
43661
43658
}
43662
43659
for (const commit of this.commits) {
43663
43660
const label = "area: " + commit.scope;
@@ -43677,17 +43674,6 @@ var CommitMessageBasedLabelManager = class {
43677
43674
core.debug(err);
43678
43675
}
43679
43676
}
43680
- async removeLabel(name) {
43681
- const { number: issue_number, owner, repo } = import_github2.context.issue;
43682
- try {
43683
- await this.git.issues.removeLabel({ repo, owner, issue_number, name });
43684
- core.info(`Added ${name} label to PR #${issue_number}`);
43685
- this.labels.delete(name);
43686
- } catch (err) {
43687
- core.error(`Failed to add ${name} label to PR #${issue_number}`);
43688
- core.debug(err);
43689
- }
43690
- }
43691
43677
async initialize() {
43692
43678
const { number, owner, repo } = import_github2.context.issue;
43693
43679
await this.git.paginate(this.git.issues.listLabelsForRepo, { owner, repo }).then((labels) => labels.filter((l) => l.name.startsWith("area: ")).forEach((l) => this.repoAreaLabels.add(l.name)));
You can’t perform that action at this time.
0 commit comments