Skip to content

Commit 9107595

Browse files
phillipjaddaleax
authored andcommitted
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: #34555 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Mary Marchini <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Shelley Vohr <[email protected]>
1 parent 60774c0 commit 9107595

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/comment-stalled.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Comment on issues and PRs when labelled stalled
2+
on:
3+
issues:
4+
types: [labeled]
5+
pull_request_target:
6+
types: [labeled]
7+
8+
jobs:
9+
staleComment:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Post comment
13+
if: github.event.label.name == 'stalled'
14+
env:
15+
COMMENTS_URL: ${{ github.event.issue.comments_url || github.event.pull_request.comments_url }}
16+
run: |
17+
curl -X POST $COMMENTS_URL \
18+
-H "Content-Type: application/json" \
19+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
20+
--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." }'

0 commit comments

Comments
 (0)