| 1 |
name: Close Inactive Issues |
| 2 |
on: |
| 3 |
schedule: |
| 4 |
- cron: "30 1 * * *" |
| 5 |
issues: |
| 6 |
types: [labeled] |
| 7 |
|
| 8 |
jobs: |
| 9 |
notify-on-label: |
| 10 |
if: github.event_name == 'issues' && github.event.label.name == 'autoclose' |
| 11 |
runs-on: ubuntu-latest |
| 12 |
permissions: |
| 13 |
issues: write |
| 14 |
steps: |
| 15 |
- name: Comment on autoclose label |
| 16 |
env: |
| 17 |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 18 |
GH_REPO: ${{ github.repository }} |
| 19 |
run: gh issue comment ${{ github.event.issue.number }} --body "This issue has been marked for autoclose and will be closed after 14 days of inactivity." |
| 20 |
|
| 21 |
close-issues: |
| 22 |
if: github.event_name == 'schedule' |
| 23 |
runs-on: ubuntu-latest |
| 24 |
permissions: |
| 25 |
issues: write |
| 26 |
pull-requests: write |
| 27 |
steps: |
| 28 |
- uses: actions/stale@v5 |
| 29 |
with: |
| 30 |
only-labels: autoclose |
| 31 |
days-before-issue-stale: 7 |
| 32 |
days-before-issue-close: 7 |
| 33 |
stale-issue-label: "stale" |
| 34 |
stale-issue-message: "This issue is stale because it has been open for 7 days with no activity." |
| 35 |
close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale." |
| 36 |
days-before-pr-stale: -1 |
| 37 |
days-before-pr-close: -1 |
| 38 |
repo-token: ${{ secrets.GITHUB_TOKEN }} |