diff --git a/.github/workflows/comment-stalled.yml b/.github/workflows/comment-stalled.yml new file mode 100644 index 00000000000000..62bd26f39eb72d --- /dev/null +++ b/.github/workflows/comment-stalled.yml @@ -0,0 +1,20 @@ +name: Comment on issues and PRs when labelled stalled +on: + issues: + types: [labeled] + pull_request_target: + types: [labeled] + +jobs: + staleComment: + runs-on: ubuntu-latest + steps: + - name: Post comment + if: github.event.label.name == 'stalled' + env: + COMMENTS_URL: ${{ github.event.issue.comments_url || github.event.pull_request.comments_url }} + run: | + curl -X POST $COMMENTS_URL \ + -H "Content-Type: application/json" \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + --data '{ "body": "This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open." }'