Skip to content

Scheduled Fix

Generic base workflow for scheduled fixers — pick up an open issue and create a focused PR that addresses it.

Workflow source: gh-aw-scheduled-fix.md

How it works

The fix agent follows a standard 5-step process (gather candidates, select target, implement, quality gate, create PR) defined by the scheduled-fix fragment. You provide the Fix Assignment via the additional-instructions input, which tells the agent how to find issues, what kind of changes to make, and any domain-specific constraints.

This is the base workflow. For domain-specific fixers, see the specialized workflows: - Bug Exterminator — fix bug-hunter issues - Text Beautifier — fix text-auditor issues - Code Duplication Fixer — fix code-duplication-detector issues

Quick Install

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

Trigger

Event Schedule
schedule Weekdays
workflow_dispatch Manual

Inputs

Input Description Required Default
additional-instructions Domain-specific fix instructions (the Fix Assignment) Yes
issue-title-prefix Title prefix to search for in open issues, e.g. [my-audit] Yes
issue-label Label to search for in open issues No ""
setup-commands Shell commands run before the agent starts No ""
allowed-bot-users Allowlisted bot actor usernames (comma-separated) No github-actions[bot]
draft-prs Create PRs as draft (true/false) No true

Safe Outputs

  • create-pull-request — open a PR with the fix (max 1)

Pairing

Pair this with a Scheduled Audit workflow. The audit detects issues; the fix resolves them.

Example Workflow

name: Scheduled Fix
on:
  schedule:
    - cron: "0 14 * * 1-5"
  workflow_dispatch:

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

jobs:
  run:
    uses: elastic/ai-github-actions/.github/workflows/gh-aw-scheduled-fix.lock.yml@v0
    with:
      issue-title-prefix: "[my-audit]"
      issue-label: "my-audit"
      additional-instructions: |
        Describe domain-specific fix instructions here.

        ### Candidate Search
        Search for open issues matching your detector:
        ```
        github-search_issues: query="repo:{owner}/{repo} is:issue is:open label:my-audit sort:updated-asc"
        ```

        ### Implementation
        1. Read the affected files
        2. Apply the fix described in the issue
        3. Run tests
        4. Commit locally
    secrets:
      COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}