Skip to content

add gha to label and close stale pull requests#290

Open
kristinmerbach wants to merge 1 commit intotrunkfrom
stale_prs
Open

add gha to label and close stale pull requests#290
kristinmerbach wants to merge 1 commit intotrunkfrom
stale_prs

Conversation

@kristinmerbach
Copy link
Copy Markdown
Contributor

@kristinmerbach kristinmerbach commented Oct 21, 2025

Adding the GHA currently used in enroll to identify and close out old PRs

Summary by CodeRabbit

  • Chores
    • Implemented automated workflow to identify and mark stale issues and pull requests after 30 days of inactivity.

@kristinmerbach kristinmerbach enabled auto-merge (squash) October 21, 2025 21:31
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 21, 2025

Walkthrough

A new GitHub Actions workflow is added to automatically identify and mark issues and pull requests as stale after 30 days of inactivity, running on a daily schedule with custom messages and labels.

Changes

Cohort / File(s) Change Summary
GitHub Actions Workflow Configuration
\.github/workflows/stale.yml
Adds scheduled workflow to mark stale issues and pull requests using actions/stale@v5 with 30-day inactivity threshold and custom messaging

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

Hop, hop, the workflow takes flight ✨
Marking stale issues each day and night,
Thirty days rest before the sweep,
Labels and messages—promises to keep! 🐰
Fresh repos bloom when old issues sleep.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "add gha to label and close stale pull requests" is fully related to the main change in the changeset. The primary modification is adding a GitHub Actions workflow file (.github/workflows/stale.yml) that automatically identifies and handles stale pull requests, which is exactly what the title conveys. The title is clear, concise, and accurately reflects both the action being taken (adding a GitHub Actions workflow) and its purpose (labeling and closing stale PRs), matching the PR author's stated objective of "identify and close out old pull requests."
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch stale_prs

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.

Copy link
Copy Markdown
Contributor

@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: 2

🧹 Nitpick comments (1)
.github/workflows/stale.yml (1)

20-27: Consider adding additional configuration options.

The workflow is missing several useful configuration parameters that could improve stale-management behavior:

Consider adding these options:

       - uses: actions/stale@v5
         with:
           repo-token: ${{ secrets.GITHUB_TOKEN }}
           stale-issue-message: "Stale issue message"
           stale-pr-message: "Stale pull request message"
           stale-issue-label: "no-issue-activity"
           stale-pr-label: "no-pr-activity"
           days-before-stale: 30
+          days-before-close: 7
+          exempt-draft-prs: true
+          operations-per-run: 50

Rationale:

  • days-before-close: Specifies how long after marking as stale an item will be closed (gives users a grace period after being warned).
  • exempt-draft-prs: Prevents draft PRs from being marked as stale, as they may be works-in-progress.
  • operations-per-run: Limits the number of API operations per workflow run to avoid hitting GitHub API rate limits with large repositories.

Adjust these values based on your repository's needs and policies.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3a442d and 32250ab.

📒 Files selected for processing (1)
  • .github/workflows/stale.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.8)
.github/workflows/stale.yml

20-20: the runner of "actions/stale@v5" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-and-upload-image
  • GitHub Check: rspec

pull-requests: write

steps:
- uses: actions/stale@v5
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Update actions/stale to a compatible version.

The static analysis tool (actionlint) flags that actions/stale@v5 is incompatible with the current GitHub Actions runner. This will cause the workflow to fail at runtime.

Please update the action to a more recent version:

-      - uses: actions/stale@v5
+      - uses: actions/stale@v10

Note: The version number is a suggestion; please verify the latest stable version of the stale action available.


🌐 Web query:

What is the latest stable version of the actions/stale GitHub Action?

💡 Result:

The latest stable version is v10.1.0. [1]

Sources
[1] actions/stale package page on GitHub Packages (shows 10.1.0 as Latest).


Update actions/stale to v10.1.0.

The latest stable version of actions/stale is v10.1.0. The current version v5 in line 20 is incompatible with the current GitHub Actions runner and will cause the workflow to fail at runtime.

-      - uses: actions/stale@v5
+      - uses: actions/stale@v10.1.0
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/stale@v5
- uses: actions/stale@v10.1.0
🧰 Tools
🪛 actionlint (1.7.8)

20-20: the runner of "actions/stale@v5" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In .github/workflows/stale.yml around line 20, the workflow references
actions/stale@v5 which is incompatible with the current GitHub Actions runner;
update the action to actions/stale@v10.1.0 by replacing the uses value
accordingly and verify any required inputs or minor syntax changes for v10.1.0
(e.g., ensure required tokens or parameters are present) so the workflow runs
without runtime failures.

Comment on lines +23 to +24
stale-issue-message: "Stale issue message"
stale-pr-message: "Stale pull request message"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Replace placeholder messages with actionable, descriptive text.

The stale messages are generic placeholders that don't provide useful information to contributors. Users should understand why their item is marked as stale and what actions they can take to keep it active.

Consider updating the messages with more context:

-          stale-issue-message: "Stale issue message"
-          stale-pr-message: "Stale pull request message"
+          stale-issue-message: "This issue has been inactive for 30 days. Please add a comment or update the issue if it is still relevant, otherwise it will be closed in 7 days."
+          stale-pr-message: "This pull request has been inactive for 30 days. Please add a comment or make updates if you're still working on it, otherwise it will be closed in 7 days."

Customize these messages as appropriate for your repository's workflow and community guidelines.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
stale-issue-message: "Stale issue message"
stale-pr-message: "Stale pull request message"
stale-issue-message: "This issue has been inactive for 30 days. Please add a comment or update the issue if it is still relevant, otherwise it will be closed in 7 days."
stale-pr-message: "This pull request has been inactive for 30 days. Please add a comment or make updates if you're still working on it, otherwise it will be closed in 7 days."
🤖 Prompt for AI Agents
In .github/workflows/stale.yml around lines 23 to 24, the stale-issue-message
and stale-pr-message are generic placeholders; replace them with actionable,
descriptive messages that explain why the issue/PR is being marked stale, the
timeframe that triggered it, and clear instructions for maintainers/contributors
on how to reactivate it (e.g., provide a status update, reply, or reopen with
new information); ensure messages are concise, reference the inactivity period,
and include a link or reference to contribution guidelines if applicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant