Skip to content

Add workflow to close stale issues#1722

Merged
tjugdev merged 2 commits into
masterfrom
close-stale-issues
Jun 22, 2026
Merged

Add workflow to close stale issues#1722
tjugdev merged 2 commits into
masterfrom
close-stale-issues

Conversation

@tjugdev

@tjugdev tjugdev commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Overview

Add a workflow to manage stale GitHub issues. Comment and label issues as stale if they have no activity for 3 weeks, and close them if they don't see any action for another week.

Acceptance criteria

If this PR is successful, what impact does it have on the user experience?

Example: When users do X, Y should now happen.

Testing plan

How did you validate that this PR works? What literal steps did you take when manually checking that your code works?

Example:

  1. Set up test case X.
  2. Run command Y. Make sure Z happens.

This section should list concrete steps that a reviewer can sanity check and repeat on their own machine (and provide any needed test cases).

Risks

Highlight any areas that you're unsure of, want feedback on, or want reviewers to pay particular attention to.

Example: I'm not sure I did X correctly, can reviewers please double-check that for me?

Metrics

Is this change something that can or should be tracked? If so, can we do it today? And how? If its easy, do it

References

Add links to any referenced GitHub issues, Zendesk tickets, Jira tickets, Slack threads, etc.

Example:

Checklist

  • I added tests for this PR's change (or explained in the PR description why tests don't make sense).
  • If this PR introduced a user-visible change, I added documentation into docs/.
  • If this PR added docs, I added links as appropriate to the user manual's ToC in docs/README.ms and gave consideration to how discoverable or not my documentation is.
  • If this change is externally visible, I updated Changelog.md. If this PR did not mark a release, I added my changes into an ## Unreleased section at the top.
  • If I made changes to .fossa.yml or fossa-deps.{json.yml}, I updated docs/references/files/*.schema.json AND I have updated example files used by fossa init command. You may also need to update these if you have added/removed new dependency type (e.g. pip) or analysis target type (e.g. poetry).
  • If I made changes to a subcommand's options, I updated docs/references/subcommands/<subcommand>.md.

@tjugdev tjugdev requested a review from a team as a code owner June 18, 2026 21:04
@tjugdev tjugdev requested a review from nficca June 18, 2026 21:04
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

A new GitHub Actions workflow file (.github/workflows/stale.yml) is added. The workflow, named Close Stale Issues, runs on a daily cron schedule and supports manual workflow_dispatch triggers. It uses actions/stale@v10 with GITHUB_TOKEN to mark issues stale after 21 days of inactivity, then close them 7 days later, posting custom messages at each step and applying a stale label. Auto-stale and auto-close for pull requests are explicitly disabled. The job is granted write permissions for issues.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete. Only the Overview section is filled in; Acceptance criteria, Testing plan, Risks, Metrics, References, and Checklist sections remain empty or contain only template placeholders. Complete the remaining sections: provide acceptance criteria, document testing steps, identify any risks, address metrics, add relevant issue references, and check off or explain checklist items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add workflow to close stale issues' directly and clearly describes the main change—adding a GitHub workflow for managing stale issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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


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.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/stale.yml:
- Around line 3-13: Add a default-deny permissions block at the workflow level
by inserting `permissions: {}` after the `on:` section and before the `jobs:`
section, while keeping the existing `permissions: issues: write` at the job
level under the `stale` job. This ensures that if additional jobs are added to
this workflow in the future, they will not have unintended token permissions by
default.
- Around line 8-13: The stale job lacks concurrency control, allowing manual
dispatches to overlap with scheduled runs and cause duplicate comments or label
churn. Add a concurrency section to the stale job that groups all runs under a
single key (such as using github.workflow or a static string) with
cancel-in-progress set to true to ensure only one run executes at a time and any
in-progress run is cancelled when a new one starts.
- Line 15: The uses statement for actions/stale is currently pinned to a mutable
tag v10, which poses a supply-chain security risk. Replace the mutable tag v10
with a full commit SHA to ensure the workflow always uses a specific, immutable
version of the action. Look up the full commit SHA that corresponds to the v10
release on the actions/stale GitHub repository and update the uses directive to
reference that SHA instead of the tag.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: e334291e-0c4a-4899-b0ca-8cac8e0e22d7

📥 Commits

Reviewing files that changed from the base of the PR and between 52c2ae8 and 93d50c3.

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

Comment on lines +3 to +13
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write

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 | ⚡ Quick win

Set default-deny token permissions at workflow scope.

Add permissions: {} at the workflow level, then keep the job-scoped issues: write. This prevents accidental broad token grants if additional jobs are added later.

Suggested fix
 on:
   schedule:
     - cron: "0 0 * * *"
   workflow_dispatch:

+permissions: {}
+
 jobs:
   stale:
     runs-on: ubuntu-latest
     permissions:
       issues: write
📝 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
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
permissions: {}
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
🧰 Tools
🪛 zizmor (1.25.2)

[warning] 12-12: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment

(undocumented-permissions)


[info] 9-9: workflow or action definition without a name (anonymous-definition): this job

(anonymous-definition)


[warning] 3-6: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting

(concurrency-limits)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/stale.yml around lines 3 - 13, Add a default-deny
permissions block at the workflow level by inserting `permissions: {}` after the
`on:` section and before the `jobs:` section, while keeping the existing
`permissions: issues: write` at the job level under the `stale` job. This
ensures that if additional jobs are added to this workflow in the future, they
will not have unintended token permissions by default.

Source: Linters/SAST tools

Comment on lines +8 to +13
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write

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 | 🟡 Minor | ⚡ Quick win

Add concurrency control to avoid overlapping stale runs.

Without concurrency limits, manual dispatch can overlap with scheduled runs and produce duplicate comments/label churn.

Suggested fix
 jobs:
   stale:
+    concurrency:
+      group: stale-issues-workflow
+      cancel-in-progress: false
     runs-on: ubuntu-latest
     permissions:
       issues: write
📝 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
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
jobs:
stale:
concurrency:
group: stale-issues-workflow
cancel-in-progress: false
runs-on: ubuntu-latest
permissions:
issues: write
🧰 Tools
🪛 zizmor (1.25.2)

[warning] 12-12: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment

(undocumented-permissions)


[info] 9-9: workflow or action definition without a name (anonymous-definition): this job

(anonymous-definition)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/stale.yml around lines 8 - 13, The stale job lacks
concurrency control, allowing manual dispatches to overlap with scheduled runs
and cause duplicate comments or label churn. Add a concurrency section to the
stale job that groups all runs under a single key (such as using github.workflow
or a static string) with cancel-in-progress set to true to ensure only one run
executes at a time and any in-progress run is cancelled when a new one starts.

Source: Linters/SAST tools

issues: write

steps:
- uses: actions/stale@v10

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

🧩 Analysis chain

🏁 Script executed:

# Check if the stale.yml file exists and view its contents
git ls-files | grep -E "(stale|workflows)" | head -20

Repository: fossas/fossa-cli

Length of output: 502


🏁 Script executed:

# Examine the stale.yml file
if [ -f ".github/workflows/stale.yml" ]; then
  cat -n ".github/workflows/stale.yml"
else
  echo "File not found"
fi

Repository: fossas/fossa-cli

Length of output: 1022


🌐 Web query:

actions/stale v10 full commit SHA github actions

💡 Result:

The actions/stale v10.0.0 release is associated with commit SHA 3a9db7e [1]. This version was released on September 4, 2025, and introduced several updates, including an upgrade to Node 24 (which requires runners to be on version v2.327.1 or later) and the addition of a new sort-by option [2][3]. The full commit history between v9 and v10.0.0 is available on GitHub, where commit 3a9db7e is explicitly identified as the final commit for this release [2][1].

Citations:


🌐 Web query:

actions/stale commit SHA 3a9db7e full 40 character hash

💡 Result:

The full 40-character SHA hash for the commit 3a9db7e in the actions/stale repository is 3a9db7e6a41a89f618792c92c0e97cc736e1b13f [1]. This commit was authored by salmanmkc and merged on September 3, 2025, as part of Pull Request #1279, which upgraded the action to use Node.js 24 [1][2].

Citations:


🏁 Script executed:

# Try to find the full commit SHA for actions/stale v10
python3 - <<'PY'
# The shortened SHA from web search is 3a9db7e
# GitHub commit SHAs are 40 characters long
# The full SHA for 3a9db7e would typically be available via GitHub API or release tags
# For now, document what we know
import requests

try:
    # Query GitHub API for the stale action release tag v10.0.0
    response = requests.get('https://api.github.com/repos/actions/stale/releases/tags/v10.0.0')
    if response.status_code == 200:
        data = response.json()
        # Look for the target_commitish which should be the full SHA
        print(f"Tag Name: {data.get('tag_name')}")
        print(f"Target Commitish: {data.get('target_commitish')}")
        print(f"Published At: {data.get('published_at')}")
    else:
        print(f"HTTP {response.status_code}")
except Exception as e:
    print(f"Error: {e}")
PY

Repository: fossas/fossa-cli

Length of output: 69


Pin actions/stale to a full commit SHA.

Line 15 uses a mutable tag (v10), which is a supply-chain risk and violates strict action pinning policies.

Suggested fix
-    - uses: actions/stale@v10
+    - uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.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@v10
- uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
🧰 Tools
🪛 zizmor (1.25.2)

[error] 15-15: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/stale.yml at line 15, The uses statement for actions/stale
is currently pinned to a mutable tag v10, which poses a supply-chain security
risk. Replace the mutable tag v10 with a full commit SHA to ensure the workflow
always uses a specific, immutable version of the action. Look up the full commit
SHA that corresponds to the v10 release on the actions/stale GitHub repository
and update the uses directive to reference that SHA instead of the tag.

Source: Linters/SAST tools

@tjugdev tjugdev merged commit ca6ed67 into master Jun 22, 2026
19 of 20 checks passed
@tjugdev tjugdev deleted the close-stale-issues branch June 22, 2026 16:12
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.

2 participants