Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Update remove-auto-merge.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
TomeHirata committed Nov 1, 2023
1 parent db9a6d2 commit ea62d58
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/remove-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Remove Label on New Commit
name: Remove Auto-Merge Label on New Commit

on:
pull_request:
Expand All @@ -15,16 +15,16 @@ jobs:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { owner, repo, number: issue_number } = context.issue;
const labelToRemove = "your-label-name"; // Replace 'your-label-name' with the name of the label you want to remove
const labelToRemove = "automerge";
// Fetch current labels on the PR
const { data: currentLabels } = await github.issues.listLabelsOnIssue({ owner, repo, issue_number });
const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({ owner, repo, issue_number });
// Check if the label is present
const hasLabel = currentLabels.some(label => label.name === labelToRemove);
if (hasLabel) {
await github.issues.removeLabel({ owner, repo, issue_number, name: labelToRemove });
await github.rest.issues.removeLabel({ owner, repo, issue_number, name: labelToRemove });
console.log(`Removed label "${labelToRemove}" from PR #${issue_number}`);
} else {
console.log(`Label "${labelToRemove}" not found on PR #${issue_number}`);
Expand Down

0 comments on commit ea62d58

Please sign in to comment.