Skip to content

Commit 3ff273d

Browse files
committed
build: add job to close PR due to it being stale
1 parent d03fea5 commit 3ff273d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/autoclose.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,35 @@ jobs:
179179
GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
180180
GH_REPO: ${{ github.repository }}
181181
NUMBER: ${{ github.event.pull_request.number }}
182+
183+
# Define a job which closes a pull request if a pull request is considered stale:
184+
stale:
185+
186+
# Define job name:
187+
name: 'Check for stale label'
188+
189+
# Only run this job if the pull request has a specific label:
190+
if: "${{ github.event.label.name == 'autoclose: Stale' }}"
191+
192+
# Define job permissions:
193+
permissions:
194+
contents: read
195+
issues: write
196+
pull-requests: write
197+
198+
# Define the type of virtual host machine:
199+
runs-on: ubuntu-latest
200+
201+
# Define the sequence of job steps:
202+
steps:
203+
# Close the pull request:
204+
- name: 'Close pull request'
205+
run: gh pr close "$NUMBER" --comment "$BODY"
206+
env:
207+
GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
208+
GH_REPO: ${{ github.repository }}
209+
NUMBER: ${{ github.event.pull_request.number }}
210+
BODY: |
211+
This pull request has been automatically closed because it has been inactive for an extended period after changes were requested. If you still wish to pursue this contribution, feel free to reopen the pull request or submit a new one.
212+
213+
We appreciate your interest in contributing to stdlib!

0 commit comments

Comments
 (0)