Objective
Replace the insecure workflow_run trigger in ci-doctor.md with a secure scheduled trigger that uses the GitHub API to check for failed workflow runs.
Context
The CI Doctor workflow currently uses the workflow_run trigger, which poses HIGH security risks:
- Privilege Escalation Risk: Triggered workflows inherit permissions/secrets from the triggering workflow
- Branch Protection Bypass: Can execute on protected branches via unprotected branches
- Secret Exposure: Secrets available even when triggered by untrusted code
- No Review Gate: Executes automatically without code review
This is finding #1 from discussion #3945 (Static Analysis Report - November 14, 2025).
Approach
- Replace
workflow_run trigger with scheduled trigger (cron: '*/30 * * * *')
- Add
workflow_dispatch for manual triggers
- Use
actions/github-script@v7 to query GitHub API for workflow runs
- Filter for failures in the last 30 minutes to avoid duplicate processing
- Preserve all existing CI Doctor analysis logic
Files to Modify
.github/workflows/ci-doctor.md (line 47 - trigger section)
- Test the compiled
.github/workflows/ci-doctor.lock.yml after changes
Acceptance Criteria
Security Impact
Fixes HIGH severity security vulnerability that could allow:
- Arbitrary code execution with elevated permissions
- Access to repository secrets
- Modification of protected branches
- Bypass of security controls
Estimated Effort
2-4 hours
AI generated by Plan Command for discussion #3945
Objective
Replace the insecure
workflow_runtrigger inci-doctor.mdwith a secure scheduled trigger that uses the GitHub API to check for failed workflow runs.Context
The CI Doctor workflow currently uses the
workflow_runtrigger, which poses HIGH security risks:This is finding #1 from discussion #3945 (Static Analysis Report - November 14, 2025).
Approach
workflow_runtrigger with scheduled trigger (cron: '*/30 * * * *')workflow_dispatchfor manual triggersactions/github-script@v7to query GitHub API for workflow runsFiles to Modify
.github/workflows/ci-doctor.md(line 47 - trigger section).github/workflows/ci-doctor.lock.ymlafter changesAcceptance Criteria
workflow_runtrigger removed from ci-doctor.mdworkflow_dispatchtrigger added for manual executiongh aw compile ci-doctoractions: read,contents: read,issues: writeSecurity Impact
Fixes HIGH severity security vulnerability that could allow:
Estimated Effort
2-4 hours