Skip to content
Latchkey

Close stale issues and PRs workflow (js-cookie/js-cookie)

The Close stale issues and PRs workflow from js-cookie/js-cookie, explained and optimized by Latchkey.

A

CI health: A - excellent

Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: js-cookie/js-cookie.github/workflows/stale-bot.ymlLicense MITView source

What it does

This is the Close stale issues and PRs workflow from the js-cookie/js-cookie 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 and PRs

on:
  schedule:
    - cron: '0 8 * * 0'
  workflow_dispatch:

permissions: {}

jobs:
  stale:
    runs-on: ubuntu-latest
    permissions:
      issues: write
      pull-requests: write
    steps:
      - name: Close stale issues/pull requests
        uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0
        with:
          stale-issue-message: 'This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.'
          stale-pr-message: 'This pull request has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.'
          exempt-issue-labels: 'feature request,in progress,dependencies'
          days-before-stale: 90
          days-before-close: 30

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: Close stale issues and PRs
 
on:
  schedule:
    - cron: '0 8 * * 0'
  workflow_dispatch:
 
permissions: {}
 
jobs:
  stale:
    timeout-minutes: 30
    runs-on: latchkey-small
    permissions:
      issues: write
      pull-requests: write
    steps:
      - name: Close stale issues/pull requests
        uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0
        with:
          stale-issue-message: 'This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.'
          stale-pr-message: 'This pull request has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.'
          exempt-issue-labels: 'feature request,in progress,dependencies'
          days-before-stale: 90
          days-before-close: 30
 

What changed

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow