Skip to content

Fix duplicate copilot-preflight step ID when threat detection is enabled#21015

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/fix-invalid-workflow-compilation
Closed

Fix duplicate copilot-preflight step ID when threat detection is enabled#21015
Copilot wants to merge 2 commits intomainfrom
copilot/fix-invalid-workflow-compilation

Conversation

Copy link
Contributor

Copilot AI commented Mar 15, 2026

When threat detection is enabled on a Copilot workflow, the compiler emits both a main execution step and a detection execution step into the same job scope — both with id: copilot-preflight — causing GitHub Actions to reject the compiled workflow.

Changes

  • pkg/workflow/threat_detection.go: buildDetectionEngineExecutionStep already prefixed agentic_executiondetection_agentic_execution to avoid ID collisions; extends the same logic to rename copilot-preflightdetection-copilot-preflight
prefixed := strings.Replace(line, "id: agentic_execution", "id: detection_agentic_execution", 1)
prefixed = strings.Replace(prefixed, "id: copilot-preflight", "id: detection-copilot-preflight", 1)
  • Recompiled workflows: release.lock.yml (and all other affected lock files) now emit distinct step IDs — copilot-preflight for the main step, detection-copilot-preflight for the detection step.

Copilot AI and others added 2 commits March 15, 2026 01:42
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
Copy link
Contributor

@copilot do not emit copilot-preflight twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants