Skip to content

Commit

Permalink
build: add job to close PR due to it being stale
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeshifter committed Sep 24, 2024
1 parent d03fea5 commit 3ff273d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/autoclose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,35 @@ jobs:
GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.pull_request.number }}

# Define a job which closes a pull request if a pull request is considered stale:
stale:

# Define job name:
name: 'Check for stale label'

# Only run this job if the pull request has a specific label:
if: "${{ github.event.label.name == 'autoclose: Stale' }}"

# Define job permissions:
permissions:
contents: read
issues: write
pull-requests: write

# Define the type of virtual host machine:
runs-on: ubuntu-latest

# Define the sequence of job steps:
steps:
# Close the pull request:
- name: 'Close pull request'
run: gh pr close "$NUMBER" --comment "$BODY"
env:
GH_TOKEN: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.pull_request.number }}
BODY: |
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.
We appreciate your interest in contributing to stdlib!

0 comments on commit 3ff273d

Please sign in to comment.