Skip to content

Commit

Permalink
chore: comment on closed issues regarding watching
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Nov 27, 2022
1 parent 8bc3ea8 commit 409d798
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/closed-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Comment on closed issue
on:
issue_comment:
types: [created]

jobs:
closed-issue:
runs-on: ubuntu-latest
if: ${{ github.event.issue.state == 'closed' }}
steps:
- uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const body = "Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro.";
const comments = await github.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
});
if (comments.data.some(comment => comment.body === body)) {
return;
}
await github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body,
});

0 comments on commit 409d798

Please sign in to comment.