Skip to content

Add GitHub Action to automatically mark stale issues and PRs#15

Open
Aarya-Chaudhari wants to merge 3 commits intoAOSSIE-Org:mainfrom
Aarya-Chaudhari:add-stale-issue-bot
Open

Add GitHub Action to automatically mark stale issues and PRs#15
Aarya-Chaudhari wants to merge 3 commits intoAOSSIE-Org:mainfrom
Aarya-Chaudhari:add-stale-issue-bot

Conversation

@Aarya-Chaudhari
Copy link

@Aarya-Chaudhari Aarya-Chaudhari commented Mar 6, 2026

Description

This PR introduces a GitHub Action workflow to automatically mark inactive
issues and pull requests as stale.

If there is no activity for a period of time:

  • Issues and PRs are marked as stale after 30 days
  • They are automatically closed after 7 additional days of inactivity

Implementation

Added workflow:

.github/workflows/stale.yml

The workflow runs daily using a scheduled GitHub Action and uses
actions/stale to detect inactive issues and pull requests.

Benefits

  • Keeps the repository clean
  • Reduces manual maintenance
  • Helps maintainers focus on active issues

Screenshots/Recordings:

Additional Notes:

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

  • Chores
    • Automated management of stale issues and pull requests is now enabled. Inactive items will be marked as stale after 30 days of inactivity and closed after 7 additional days with no updates. The process runs daily and can be triggered manually.

@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Warning

Rate limit exceeded

@Aarya-Chaudhari has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 45 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 041ae659-5ae8-4930-98e7-aec7b4f6e128

📥 Commits

Reviewing files that changed from the base of the PR and between e1989e2 and 27069fa.

📒 Files selected for processing (1)
  • .github/workflows/stale.yml

Walkthrough

Adds a GitHub Actions workflow that runs daily (and on manual dispatch) to mark inactive issues and pull requests as "stale" after 30 days and close them after an additional 7 days, applying messages and the "stale" label.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/stale.yml
New workflow added: scheduled (daily at 01:00 UTC) and dispatchable, grants write permissions for issues/PRs, uses actions/stale to add a stale label and messages after 30 days inactivity and close after 7 more days.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Scheduler as "GitHub Scheduler\n(actions)"
    participant Workflow as "stale.yml\n(actions runner)"
    participant StaleAction as "actions/stale"
    participant GitHub as "GitHub Issues/PRs API"

    Scheduler->>Workflow: trigger (daily @ 01:00 UTC) / workflow_dispatch
    Workflow->>StaleAction: invoke with config (30d stale, 7d close, messages, label)
    StaleAction->>GitHub: list issues & PRs, check activity timestamps
    alt inactive >= 30 days
        StaleAction->>GitHub: add `stale` label and post stale message
    end
    alt stale >= 7 days after marking
        StaleAction->>GitHub: close issue/PR and post closing message
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰✨ I nibble through issues, neat and small,
Thirty days of silence — I tag them all.
A gentle note, a pause, then seven more,
I tidy the burrow, sweep every floor.
Hoppity hops — the workflow gives us all!

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add GitHub Action to automatically mark stale issues and PRs' accurately and clearly summarizes the main change: adding a new GitHub Actions workflow for stale issue/PR management.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size/S and removed size/S labels Mar 6, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/stale.yml:
- Around line 21-29: Update the stale messages to explicitly state the seven-day
close window and that both issues and PRs will be closed after that period: edit
stale-issue-message and stale-pr-message to mention "This will be closed after 7
days of inactivity" (or equivalent wording referencing days-before-close: 7) so
contributors for both issues and pull requests see the same closure warning;
keep existing label keys stale-issue-label and stale-pr-label unchanged.
- Around line 13-16: The workflow step using actions/stale@v9 (the "Mark stale
issues and PRs" job) is pinned to a mutable tag; replace the tag with the full
commit SHA for the v9 release to prevent silent upstream changes — locate the
step that has uses: actions/stale@v9 and change it to uses:
actions/stale@<full-commit-sha-of-v9> (obtain the SHA from the actions/stale v9
release on GitHub) and commit the updated workflow.
- Around line 8-16: Add an explicit permissions block for the stale job so the
actions/stale@v9 step has token rights to comment, label, and close issues/PRs:
update the job named "stale" (the job containing the actions/stale@v9 step) to
include a permissions section granting at minimum issues: write and
pull-requests: write on the GITHUB_TOKEN; keep it scoped to the job rather than
relying on repo defaults.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9c821182-60e2-4807-985a-950424d3efbb

📥 Commits

Reviewing files that changed from the base of the PR and between a3ccb2b and 42fd826.

📒 Files selected for processing (1)
  • .github/workflows/stale.yml

@github-actions github-actions bot added size/S and removed size/S labels Mar 6, 2026
@Aarya-Chaudhari
Copy link
Author

Hello @imxade

I have raised a PR to add a GitHub Action for automatically marking stale issues and pull requests. I have also addressed the CodeRabbit review suggestions and updated the workflow accordingly.

Could you please review the PR when you get a chance?

Thank you!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/stale.yml:
- Around line 17-18: Replace the invalid pinned commit SHA on the "Mark stale
issues and PRs" step (uses:
actions/stale@28c0b7fbe1c4c9cbead9f7d5c3e2de3c8c0e5f6c) with the v9.1.0 release
reference; update the uses line to use the v9.1.0 tag (uses:
actions/stale@v9.1.0) or the exact commit SHA for v9.1.0 so the workflow points
to a valid ref.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ef2a2490-4769-4ed9-a34d-93cf45020321

📥 Commits

Reviewing files that changed from the base of the PR and between 42fd826 and e1989e2.

📒 Files selected for processing (1)
  • .github/workflows/stale.yml

@github-actions github-actions bot removed the size/S label Mar 6, 2026
@github-actions github-actions bot added the size/S label Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant