mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
6c8d9b1d0f
We spend a fair amount of time closing issues because people don't read the template closely or understand what they're being told. Let's take advantage of being able to auto-label an issue based on the template and then trigger a workflow to auto-magically close the issue with a message and lock the issue.
36 lines
1.1 KiB
YAML
36 lines
1.1 KiB
YAML
name: 'Autoclose Issues'
|
|
|
|
on:
|
|
issues:
|
|
types:
|
|
- labeled
|
|
|
|
permissions:
|
|
issues: write
|
|
|
|
jobs:
|
|
close_qa:
|
|
if: github.event.label.name == 'actions/autoclose-qa'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- env:
|
|
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
|
|
ISSUE_URL: ${{ github.event.issue.html_url }}
|
|
run: |
|
|
gh issue close $ISSUE_URL \
|
|
--comment "As described in the template, this is not the appropriate place for questions. Please use Stack Overflow" \
|
|
--reason completed
|
|
gh issue lock $ISSUE_URL --reason off_topic
|
|
close_feature_request:
|
|
if: github.event.label.name == 'actions/autoclose-feat'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- env:
|
|
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
|
|
ISSUE_URL: ${{ github.event.issue.html_url }}
|
|
run: |
|
|
gh issue close $ISSUE_URL \
|
|
--comment "As described in the template, Requests is not accepting feature requests" \
|
|
--reason "not planned"
|
|
gh issue lock $ISSUE_URL --reason off_topic
|