Skip to content

Please change text color from blue to white... for the bottom info, and hide the auto fetch log #1527

Please change text color from blue to white... for the bottom info, and hide the auto fetch log

Please change text color from blue to white... for the bottom info, and hide the auto fetch log #1527

Workflow file for this run

name: Close Issues
on:
issue_comment:
types: [created]
permissions:
issues: write
jobs:
close_issue:
runs-on: ubuntu-latest
if: ${{ github.event.issue.pull_request == null && startsWith(github.event.comment.body, '/close') }}
steps:
- uses: actions/github-script@v7
with:
script: |
const trustedUsers = ['ChrisMcD1', 'jesseduffield', 'stefanhaller']
const commenter = context.payload.comment.user.login
console.log(`Commenter: ${commenter}`)
if (!trustedUsers.includes(commenter)) {
console.log(`User ${commenter} is not trusted. Ignoring.`)
return
}
const issueNumber = context.payload.issue.number
const owner = context.repo.owner
const repo = context.repo.repo
await github.rest.issues.update({
owner,
repo,
issue_number: issueNumber,
state: 'closed'
})
console.log(`Closed issue #${issueNumber} by request from ${commenter}.`)