From 1c1c4739105790c31424810aedfca8c526bcce12 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 3 Dec 2023 01:22:14 -0600 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Fix=20auto-label=20action=20comment?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/auto-label.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto-label.yml b/.github/workflows/auto-label.yml index c3cbb3b210..c69e6c4fad 100644 --- a/.github/workflows/auto-label.yml +++ b/.github/workflows/auto-label.yml @@ -20,21 +20,18 @@ jobs: uses: actions/github-script@v7 with: script: | - # Get all open issues in this repository + // Get all open issues in this repository const issueList = await github.rest.issues.listForRepo({ owner: context.repo.owner, repo: context.repo.repo, state: 'open' }); - # Filter the list of issues to only those that don't have any labels - # and have a title that contains '[BUG]'. Only the first 50 issues. + // Filter issues without labels that have a title containing '[BUG]'. const matchingIssues = issueList.data.filter( issue => issue.title.includes('[BUG]') && issue.labels.length === 0 ); - # Process the first 50 + // Process the first 50 for (const issue of matchingIssues.slice(0, 50)) { - // Run the desired action on the issue - // For example, to add a label: await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo,