Skip to content

Stale Issues

Find open issues that appear to already be resolved and recommend closing them.

Investigation strategy

The agent starts with high-signal candidates (linked PRs, resolution language in comments, and long-stale updates) and includes coverage stats in no-op runs (total open issues, candidate count, analyzed count).

Quick Install

mkdir -p .github/workflows && curl -sL \
  https://raw.githubusercontent.com/elastic/ai-github-actions/v0/gh-agent-workflows/stale-issues/example.yml \
  -o .github/workflows/stale-issues.yml

Agentic Maintenance Required

This workflow emits expiring safe-outputs and needs the agentics-maintenance workflow to close expired reports. Install it once per repo:

mkdir -p .github/workflows && curl -sL \
  https://raw.githubusercontent.com/elastic/ai-github-actions/v0/.github/workflows/agentics-maintenance.yml \
  -o .github/workflows/agentics-maintenance.yml

Trigger

Event Schedule
schedule Weekdays
workflow_dispatch Manual

Inputs

Input Description Required Default
additional-instructions Repo-specific instructions appended to the agent prompt No ""
setup-commands Shell commands run before the agent starts No ""
allowed-bot-users Allowlisted bot actor usernames (comma-separated) No github-actions[bot]

Safe Outputs

  • create-issue — file a stale issues report (max 1, auto-closes older reports)

Example Workflow

name: Stale Issues
on:
  schedule:
    - cron: "0 15 * * 1-5"
  workflow_dispatch:

permissions:
  contents: read
  issues: write
  pull-requests: read

jobs:
  run:
    uses: elastic/ai-github-actions/.github/workflows/gh-aw-stale-issues.lock.yml@v0
    secrets:
      COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}