From 3ab5d03c7fd536d735b1aeeaf828d6f5c64a78df Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Wed, 5 Nov 2025 16:06:26 +0530 Subject: [PATCH] ci : add github action stale to automatically flag and close inactive issues Add GitHub action to automatically add comments on inactive issues and close them after a week of activity. Signed-off-by: Rohan Kumar --- .github/workflows/stale.yml | 60 +++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000000..e9395f3b77c --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,60 @@ +name: "Lifecycle: Mark and close stale issues" + +on: + schedule: + - cron: "0 2 * * *" # Run every day at 02:00 UTC + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + contents: read + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v10 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + # --- Issue configuration --- + stale-issue-label: "lifecycle/stale" + exempt-issue-labels: "lifecycle/frozen" + remove-issue-stale-when-updated: true + days-before-issue-stale: 180 + days-before-issue-close: 7 + stale-issue-message: > + This issue has been automatically marked as stale due to 180 days of inactivity. + + If this issue is still relevant, please add a comment to keep it open. + + Otherwise, it will be closed after 7 more days of inactivity. + + Moderators: Add the `lifecycle/frozen` label to exempt this issue from the stale process. + close-issue-message: > + Closing this issue as it remained inactive after being marked `lifecycle/stale`. + + # --- PR configuration --- + stale-pr-label: "lifecycle/stale" + exempt-pr-labels: "lifecycle/frozen" + remove-pr-stale-when-updated: true + exempt-draft-pr: false + days-before-pr-stale: 180 + days-before-pr-close: 7 + stale-pr-message: > + This pull request has been automatically marked as stale due to 180 days of inactivity. + + Please update it or comment if you intend to continue working on it. + + It will be closed after 7 more days of inactivity. + + Moderators: Add the `lifecycle/frozen` label to exempt this PR from the stale process. + close-pr-message: > + Closing this pull request as it remained inactive after being marked `lifecycle/stale`. + + # --- Shared settings --- + labels-to-remove-when-unstale: "lifecycle/stale" + sort-by: "created" + start-date: "2025-11-03T00:24:55Z" + operations-per-run: 100