Add GitHub Action to automatically mark stale issues and PRs#15
Add GitHub Action to automatically mark stale issues and PRs#15Aarya-Chaudhari wants to merge 3 commits intoAOSSIE-Org:mainfrom
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
.github/workflows/stale.yml
|
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! |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
.github/workflows/stale.yml
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:
Implementation
Added workflow:
.github/workflows/stale.yml
The workflow runs daily using a scheduled GitHub Action and uses
actions/staleto detect inactive issues and pull requests.Benefits
Screenshots/Recordings:
Additional Notes:
Checklist
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