Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/agents-pr-health.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# ---------------------------------------------------------------------------
# Agents PR Health — Consumer Repo Thin Wrapper
# ---------------------------------------------------------------------------
# Periodically scans open PRs for merge conflicts and failing checks,
# then routes remediation to the coding agent that most recently worked
# on each PR.
#
# Copy this file to: .github/workflows/agents-pr-health.yml
#
# Required secrets (inherited from org / repo):
# - WORKFLOWS_APP_ID / WORKFLOWS_APP_PRIVATE_KEY (preferred)
# - ACTIONS_BOT_PAT or SERVICE_BOT_PAT (fallback)
# ---------------------------------------------------------------------------

name: Agents PR Health

on:
schedule:
# Every 6 hours — frequent enough to catch drift, rare enough to
# stay well within rate limits and agent cost budgets.
- cron: '0 */6 * * *'
workflow_dispatch:
inputs:
dry_run:
description: 'Preview mode — scan and report without pushing or dispatching'
required: false
default: false
type: boolean
max_prs:
description: 'Maximum PRs to process'
required: false
default: 10
type: number

permissions:
contents: write
pull-requests: write
actions: write

concurrency:
group: pr-health-${{ github.repository }}
cancel-in-progress: true

jobs:
health:
uses: stranske/Workflows/.github/workflows/reusable-agents-pr-health.yml@main
with:
dry_run: ${{ inputs.dry_run || false }}
max_prs: ${{ inputs.max_prs || 10 }}
Comment on lines +48 to +49
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputs.* context is only available for workflow_dispatch / workflow_call. Because this workflow also runs on schedule, the expressions inputs.dry_run and inputs.max_prs can fail with "Unrecognized named-value: 'inputs'" on scheduled runs. Use github.event.inputs.* (with defaults) or guard on github.event_name == 'workflow_dispatch' so scheduled executions always have valid values.

Suggested change
dry_run: ${{ inputs.dry_run || false }}
max_prs: ${{ inputs.max_prs || 10 }}
dry_run: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run || false }}
max_prs: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.max_prs || 10 }}

Copilot uses AI. Check for mistakes.
secrets: inherit
Loading
Loading