Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions github-actions/commit-message-based-labels/lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down
14 changes: 0 additions & 14 deletions github-actions/commit-message-based-labels/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)));
Expand Down