From b23a932bfd22cc58829dd86fb9ac8e5da7caec98 Mon Sep 17 00:00:00 2001 From: Phillip Johnsen Date: Mon, 10 Aug 2020 22:41:02 +0200 Subject: [PATCH] build: comment about auto close when stalled via with github action As part of automatically closing issues and PRs 30 days after they got labelled with `stalled`, these changes adds a GitHub Action workflow posting a comment information about what will happen in 30 days upon being labelled. PR-URL: https://github.com/nodejs/node/pull/34555 Reviewed-By: James M Snell Reviewed-By: Mary Marchini Reviewed-By: Denys Otrishko Reviewed-By: Gus Caplan Reviewed-By: Zeyu Yang Reviewed-By: Michael Dawson Reviewed-By: Shelley Vohr --- .github/workflows/comment-stalled.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/comment-stalled.yml 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." }'