🦧「リファクタに 成功したら 褒めてくれ 」 #19
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: Close Non-Owner Issues | |
permissions: | |
issues: write | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
close_non_owner_issues: | |
runs-on: ubuntu-latest | |
if: github.actor != 'phpcon-odawara-jp' | |
steps: | |
- name: Close Issue if Not Owner | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const issue_number = context.issue.number; | |
await github.rest.issues.update({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number, | |
state: "closed" | |
}); | |
- name: Comment on Closed Issue | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const issue_number = context.issue.number; | |
await github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number, | |
body: "このIssueはリポジトリオーナー以外によって作成されたため、自動的にクローズされました。" | |
}); |