Skip to content

Close inactive pull request and issue #507

Close inactive pull request and issue

Close inactive pull request and issue #507

# GitHub Actions workflow to automatically close inactive issues and pull requests
# This workflow runs daily at 1:30 AM UTC and can be triggered manually
name: Close inactive pull request and issue
on:
schedule:
- cron: "30 1 * * *" # Run daily at 1:30 AM UTC
workflow_dispatch: # Allow manual triggering of the workflow
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write # Permission to modify issues
pull-requests: write # Permission to modify pull requests
steps:
# Use the stale action to manage inactive issues and PRs
- uses: actions/stale@v5
with:
# Issue configuration
days-before-issue-stale: 60 # Mark issues as stale after 60 days of inactivity
days-before-issue-close: 30 # Close stale issues after 30 additional days
stale-issue-label: "stale" # Label to apply to stale issues
stale-issue-message: "This issue is stale because it has been open for 60 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 30 days since being marked as stale."
# Pull request configuration
days-before-pr-stale: 60 # Mark PRs as stale after 60 days of inactivity
days-before-pr-close: 30 # Close stale PRs after 30 additional days
stale-pr-message: "This pull request is stale because it has been open for 60 days with no activity."
close-pr-message: "This pull request was closed because it has been inactive for 30 days since being marked as stale."
repo-token: ${{ secrets.GITHUB_TOKEN }} # GitHub token for API access