zircuit New Contribution #6
This file contains 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: Auto Close Issues | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
close_issue: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Close new issue | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const issueNumber = context.issue.number; | |
const issueMessage = "The ceremony has ended! Thank you for your interest in participating in the ceremony!"; | |
await github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: issueNumber, | |
body: issueMessage | |
}); | |
await github.rest.issues.update({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: issueNumber, | |
state: 'closed' | |
}); |