[BUG] Sun Spot Number Incorrect #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Close Issue | ||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
| jobs: | ||
| close-issue: | ||
| if: github.repository == 'accius/openhamclock' | ||
| runs-on: ubuntu-latest | ||
| # Only trigger on '/close' comments on issues (not PRs) | ||
| # Note: Using both conditions in the same if block | ||
| steps: | ||
| - name: Check comment body | ||
| if: | | ||
| github.event.comment.body == '/close' && | ||
| github.event.issue.pull_request == null | ||
| uses: actions/github-script@v7 | ||
| permissions: | ||
| issues: write | ||
| with: | ||
| script: | | ||
| const { actor } = context; | ||
| const issueNumber = context.issue.number; | ||
| // Close the issue | ||
| await github.rest.issues.update({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: issueNumber, | ||
| state: 'closed', | ||
| state_reason: 'completed' | ||
| }); | ||
| // React with ✅ so they know it worked | ||
| await github.rest.reactions.createForIssueComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| comment_id: context.payload.comment.id, | ||
| content: 'rocket' | ||
| }); | ||
| console.log(`${actor} closed issue #${issueNumber}`); | ||