diff --git a/github-actions/commit-message-based-labels/lib/main.ts b/github-actions/commit-message-based-labels/lib/main.ts index c0acf38b4..0e6e2f36a 100644 --- a/github-actions/commit-message-based-labels/lib/main.ts +++ b/github-actions/commit-message-based-labels/lib/main.ts @@ -49,9 +49,6 @@ class CommitMessageBasedLabelManager { if (hasCommit && !hasLabel) { await this.addLabel(name); } - if (!hasCommit && hasLabel) { - await this.removeLabel(name); - } } for (const commit of this.commits) { @@ -78,19 +75,6 @@ class CommitMessageBasedLabelManager { } } - /** Remove the provided label from the pull request. */ - async removeLabel(name: string) { - const {number: issue_number, owner, repo} = context.issue; - try { - await this.git.issues.removeLabel({repo, owner, issue_number, name}); - core.info(`Added ${name} label to PR #${issue_number}`); - this.labels.delete(name); - } catch (err) { - core.error(`Failed to add ${name} label to PR #${issue_number}`); - core.debug(err as string); - } - } - /** Initialize the current labels and commits for the PR. */ async initialize() { const {number, owner, repo} = context.issue; diff --git a/github-actions/commit-message-based-labels/main.js b/github-actions/commit-message-based-labels/main.js index 19297284a..166a08ebc 100644 --- a/github-actions/commit-message-based-labels/main.js +++ b/github-actions/commit-message-based-labels/main.js @@ -43655,9 +43655,6 @@ var CommitMessageBasedLabelManager = class { if (hasCommit && !hasLabel) { await this.addLabel(name); } - if (!hasCommit && hasLabel) { - await this.removeLabel(name); - } } for (const commit of this.commits) { const label = "area: " + commit.scope; @@ -43677,17 +43674,6 @@ var CommitMessageBasedLabelManager = class { core.debug(err); } } - async removeLabel(name) { - const { number: issue_number, owner, repo } = import_github2.context.issue; - try { - await this.git.issues.removeLabel({ repo, owner, issue_number, name }); - core.info(`Added ${name} label to PR #${issue_number}`); - this.labels.delete(name); - } catch (err) { - core.error(`Failed to add ${name} label to PR #${issue_number}`); - core.debug(err); - } - } async initialize() { const { number, owner, repo } = import_github2.context.issue; 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)));