close-stale-issues workflow (thevickypedia/Jarvis)
The close-stale-issues workflow from thevickypedia/Jarvis, explained and optimized by Latchkey.
A
CI health: A - excellent
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the close-stale-issues workflow from the thevickypedia/Jarvis repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
workflow (.yml)
name: close-stale-issues
on:
schedule:
- cron: "0 2 * * *"
workflow_dispatch:
permissions:
issues: write
jobs:
stale:
runs-on: thevickypedia-default
steps:
- name: Close stale issues
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Mark as stale after 30 days of inactivity
days-before-stale: 30
# Close immediately after being marked stale
days-before-close: 0
stale-issue-message: >
This issue has been automatically marked as stale because it has not had
recent activity in the last 30 days.
If this is still relevant, please comment and it will be reopened.
close-issue-message: >
Closing this issue due to inactivity. Feel free to reopen if needed.
stale-pr-message: ""
days-before-pr-stale: -1
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: close-stale-issues on: schedule: - cron: "0 2 * * *" workflow_dispatch: permissions: issues: write jobs: stale: timeout-minutes: 30 runs-on: thevickypedia-default steps: - name: Close stale issues uses: actions/stale@v9 with: repo-token: ${{ secrets.GITHUB_TOKEN }} # Mark as stale after 30 days of inactivity days-before-stale: 30 # Close immediately after being marked stale days-before-close: 0 stale-issue-message: > This issue has been automatically marked as stale because it has not had recent activity in the last 30 days. If this is still relevant, please comment and it will be reopened. close-issue-message: > Closing this issue due to inactivity. Feel free to reopen if needed. stale-pr-message: "" days-before-pr-stale: -1
What changed
- Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.