Summary
The daily re-trigger sweep (scripts/compliance-retrigger.sh) does more than re-trigger stale issues: Step 1 (check_devlead_workflows) inspects every fleet repo's dev-lead.yml and silently re-enables it if it finds the workflow disabled_manually or disabled_inactivity. This is out of scope for a re-trigger sweep and should be removed.
Evidence
scripts/compliance-retrigger.sh (on main):
check_devlead_workflows() — defined at line 92; called from main() at line 359.
- It enables workflows via the API at line 116:
gh api -X PUT "repos/$ORG/$repo/actions/workflows/$wf_id/enable"
- The summary even reports it:
Workflows re-enabled: ${WORKFLOWS_DISABLED} (lines 132, 332, 345).
The job declares permissions: contents: read (.github/workflows/compliance-retrigger.yml:31) but performs this mutation through the ORG_SCORECARD_TOKEN PAT, bypassing the workflow's stated least-privilege boundary.
Why this is invalid
- Separation of concerns. A "re-trigger stale issues" sweep should re-fire
issues:labeled events — nothing more. Mutating the enablement state of another workflow is a different responsibility with a different owner.
- Overrides deliberate intent. If a maintainer disables
dev-lead in a repo on purpose (incident response, a noisy/looping agent, a repo being wound down), the next daily sweep silently turns it back on within 24h — an unwanted, surprising side effect.
- Least-privilege violation. The job advertises
contents: read but performs actions: write-class mutations via a PAT. The visible permission contract understates what the job actually does.
- Hidden cross-repo writes. A governance sweep quietly changing config across the whole fleet is hard to audit and easy to forget exists.
Recommended Actions
- Remove
check_devlead_workflows() and its call site from scripts/compliance-retrigger.sh, along with the WORKFLOWS_DISABLED / WORKFLOWS_ENABLED counters and their summary lines (console + step summary).
- Keep the sweep focused solely on Step 2 (re-trigger stale issues, one engagement per repo per run).
- If "dev-lead must stay enabled fleet-wide" is a real requirement, move that enforcement to a dedicated, clearly-named workflow (e.g.
dev-lead-workflow-health) that:
- declares the permission it actually needs,
- logs/justifies each enable as its own auditable action,
- and ideally reports a disabled workflow rather than auto-overriding a maintainer's deliberate disable.
- Update the script header docstring (the "What it does" section) to drop Step 1.
Acceptance Criteria
compliance-retrigger.sh no longer reads or modifies any repo's dev-lead.yml enablement state.
- The sweep's behaviour is unchanged for issue re-triggering.
- Dry-run output and step summary no longer mention "workflows re-enabled".
Context
Identified while documenting the daily sweep (follow-up to #431 / PR #432). Part of the Compliance program initiative (GH Project #1 Initiatives).
Summary
The daily re-trigger sweep (
scripts/compliance-retrigger.sh) does more than re-trigger stale issues: Step 1 (check_devlead_workflows) inspects every fleet repo'sdev-lead.ymland silently re-enables it if it finds the workflowdisabled_manuallyordisabled_inactivity. This is out of scope for a re-trigger sweep and should be removed.Evidence
scripts/compliance-retrigger.sh(onmain):check_devlead_workflows()— defined at line 92; called frommain()at line 359.gh api -X PUT "repos/$ORG/$repo/actions/workflows/$wf_id/enable"Workflows re-enabled: ${WORKFLOWS_DISABLED}(lines 132, 332, 345).The job declares
permissions: contents: read(.github/workflows/compliance-retrigger.yml:31) but performs this mutation through theORG_SCORECARD_TOKENPAT, bypassing the workflow's stated least-privilege boundary.Why this is invalid
issues:labeledevents — nothing more. Mutating the enablement state of another workflow is a different responsibility with a different owner.dev-leadin a repo on purpose (incident response, a noisy/looping agent, a repo being wound down), the next daily sweep silently turns it back on within 24h — an unwanted, surprising side effect.contents: readbut performsactions: write-class mutations via a PAT. The visible permission contract understates what the job actually does.Recommended Actions
check_devlead_workflows()and its call site fromscripts/compliance-retrigger.sh, along with theWORKFLOWS_DISABLED/WORKFLOWS_ENABLEDcounters and their summary lines (console + step summary).dev-lead-workflow-health) that:Acceptance Criteria
compliance-retrigger.shno longer reads or modifies any repo'sdev-lead.ymlenablement state.Context
Identified while documenting the daily sweep (follow-up to #431 / PR #432). Part of the Compliance program initiative (GH Project #1 Initiatives).