Skip to content

Commit

Permalink
✅ Fix auto-label action comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 3, 2023
1 parent dde878d commit 1c1c473
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/auto-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1c1c473

Please sign in to comment.