Fix auto-label action comments

This commit is contained in:
Scott Lahteine 2023-12-03 01:22:14 -06:00
parent dde878db04
commit 1c1c473910

View file

@ -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,