Skip to content
Latchkey

Close Stale Threads workflow (PowerDNS-Admin/PowerDNS-Admin)

The Close Stale Threads workflow from PowerDNS-Admin/PowerDNS-Admin, 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: PowerDNS-Admin/PowerDNS-Admin.github/workflows/stale.ymlLicense MITView source

What it does

This is the Close Stale Threads workflow from the PowerDNS-Admin/PowerDNS-Admin 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)
# close-stale-issues (https://github.com/marketplace/actions/close-stale-issues)
name: 'Close Stale Threads'

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

permissions:
  issues: write
  pull-requests: write

jobs:
  stale:

    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@v6
        with:
          close-issue-message: >
            This issue has been automatically closed due to lack of activity. In an
            effort to reduce noise, please do not comment any further. Note that the
            core maintainers may elect to reopen this issue at a later date if deemed
            necessary.
          close-pr-message: >
            This PR has been automatically closed due to lack of activity.
          days-before-stale: 90
          days-before-close: 30
          exempt-issue-labels: 'bug / security-vulnerability, mod / announcement, mod / accepted, mod / reviewing, mod / testing'
          operations-per-run: 100
          remove-stale-when-updated: false
          stale-issue-label: 'mod / stale'
          stale-issue-message: >
            This issue has been automatically marked as stale because it has not had
            recent activity. It will be closed if no further activity occurs. PDA
            is governed by a small group of core maintainers which means not all opened
            issues may receive direct feedback. **Do not** attempt to circumvent this
            process by "bumping" the issue; doing so will result in its immediate closure
            and you may be barred from participating in any future discussions. Please see our
            [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md).
          stale-pr-label: 'mod / stale'
          stale-pr-message: >
            This PR has been automatically marked as stale because it has not had
            recent activity. It will be closed automatically if no further action is
            taken. Please see our
            [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md).

The same workflow, on Latchkey

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

# close-stale-issues (https://github.com/marketplace/actions/close-stale-issues)
name: 'Close Stale Threads'
 
on:
  schedule:
    - cron: '0 4 * * *'
  workflow_dispatch:
 
permissions:
  issues: write
  pull-requests: write
 
jobs:
  stale:
    timeout-minutes: 30
 
    runs-on: latchkey-small
    steps:
      - uses: actions/stale@v6
        with:
          close-issue-message: >
            This issue has been automatically closed due to lack of activity. In an
            effort to reduce noise, please do not comment any further. Note that the
            core maintainers may elect to reopen this issue at a later date if deemed
            necessary.
          close-pr-message: >
            This PR has been automatically closed due to lack of activity.
          days-before-stale: 90
          days-before-close: 30
          exempt-issue-labels: 'bug / security-vulnerability, mod / announcement, mod / accepted, mod / reviewing, mod / testing'
          operations-per-run: 100
          remove-stale-when-updated: false
          stale-issue-label: 'mod / stale'
          stale-issue-message: >
            This issue has been automatically marked as stale because it has not had
            recent activity. It will be closed if no further activity occurs. PDA
            is governed by a small group of core maintainers which means not all opened
            issues may receive direct feedback. **Do not** attempt to circumvent this
            process by "bumping" the issue; doing so will result in its immediate closure
            and you may be barred from participating in any future discussions. Please see our
            [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md).
          stale-pr-label: 'mod / stale'
          stale-pr-message: >
            This PR has been automatically marked as stale because it has not had
            recent activity. It will be closed automatically if no further action is
            taken. Please see our
            [Contribution Guide](https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/master/docs/CONTRIBUTING.md).

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