Skip to content

[WIP] Fix failing GitHub Actions workflow Integration: Workflow Misc Part 2#15341

Merged
pelikhan merged 5 commits intomainfrom
copilot/fix-github-actions-workflow-663ff11b-f009-4b18-a194-995ebbcb3d75
Feb 13, 2026
Merged

[WIP] Fix failing GitHub Actions workflow Integration: Workflow Misc Part 2#15341
pelikhan merged 5 commits intomainfrom
copilot/fix-github-actions-workflow-663ff11b-f009-4b18-a194-995ebbcb3d75

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

Fix label trigger shorthand schema validation

Problem Analysis

  • Identify failing test: TestTriggerShorthandBackwardCompatibility/label_trigger_shorthand
  • Analyze root cause: Schema validation rejects labels field in issues trigger
  • Review label trigger parser code (label_trigger_parser.go)
  • Check schema validation flow (compiler_orchestrator_frontmatter.go)
  • Examine frontmatter schema (main_workflow_schema.json)

Root Cause

The expandLabelTriggerShorthand function added a labels field to the issues trigger configuration for native GitHub Actions label filtering. However:

  1. GitHub Actions does NOT support native label filtering for ANY event type (issues, pull_request, discussion)
  2. The frontmatter schema correctly only allows types, names, and lock-for-agent properties for issues events
  3. The code incorrectly assumed issues events support a native labels field

Solution Implemented

  • Update expandLabelTriggerShorthand to use names field for all event types
  • Remove special handling for issues that added labels and __gh_aw_native_label_filter__ marker
  • Update function comments to reflect correct behavior
  • Update tests to expect names field for all entity types
  • Remove expectation of native label filter marker in integration tests
  • Fix fuzz test that incorrectly expected discussion to not have names field
  • Rebuild binary and recompile all workflow files
  • Verify failing test now passes

Testing

  • TestTriggerShorthandBackwardCompatibility - now passes ✅
  • TestExpandLabelTriggerShorthand - updated and passes ✅
  • TestLabelTriggerIntegration* - all pass ✅
  • FuzzExpandLabelTriggerShorthand - fixed and passes ✅
  • All unit tests pass (make test-unit) ✅
  • All workflows recompiled successfully (149/149) ✅
Original prompt

Fix the failing GitHub Actions workflow Integration: Workflow Misc Part 2
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 63497179646
Job URL: https://github.com/github/gh-aw/actions/runs/21979101109/job/63497179646


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 13, 2026 08:02
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Remove incorrect assumption that GitHub Actions supports native label filtering for issues
- Change issues events to use 'names' field (same as pull_request and discussion)
- Update label trigger parser to use job condition filtering for all event types
- Update tests to reflect new behavior
- Recompile all workflow files

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Update FuzzExpandLabelTriggerShorthand to expect names field for all event types including discussion, matching the corrected behavior where all events use job condition filtering

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review February 13, 2026 08:11
Copilot AI review requested due to automatic review settings February 13, 2026 08:11
@pelikhan pelikhan merged commit 2c6e321 into main Feb 13, 2026
48 checks passed
@pelikhan pelikhan deleted the copilot/fix-github-actions-workflow-663ff11b-f009-4b18-a194-995ebbcb3d75 branch February 13, 2026 08:12
Copilot stopped work on behalf of pelikhan due to an error February 13, 2026 08:12
Copilot AI requested a review from pelikhan February 13, 2026 08:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a schema validation failure in label trigger shorthand expansion by correcting the implementation to use the internal names field for job condition filtering instead of attempting to use GitHub Actions' native label filtering (which doesn't exist for any event type).

Changes:

  • Removed incorrect use of native GitHub Actions labels field and __gh_aw_native_label_filter__ marker for issues events
  • Updated expandLabelTriggerShorthand to use names field consistently for all event types (issues, pull_request, discussion)
  • Updated all tests (unit, fuzz, and integration) to reflect the corrected behavior

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
pkg/workflow/label_trigger_parser.go Core fix: Simplified label trigger expansion to use names field for all event types, removing special case for issues events and the native filter marker
pkg/workflow/label_trigger_parser_test.go Updated unit tests to expect names field for all entity types instead of conditional labels/names based on event type
pkg/workflow/label_trigger_parser_fuzz_test.go Fixed fuzz test to correctly expect names field for all event types including discussion
pkg/workflow/label_trigger_integration_test.go Updated integration test to verify the native filter marker is NOT present in expanded triggers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// All event types use `names` field for job condition filtering
// The `names` field is an internal representation for job condition generation
// and won't be rendered in the final GitHub Actions YAML for these event types
triggerConfig["names"] = labelNames
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The code now adds the names field to all event types including discussion, but the schema definition for the discussion event in pkg/parser/schemas/main_workflow_schema.json (lines 617-630) does not include a names property and has "additionalProperties": false. This will cause schema validation to fail when compiling workflows with discussion label triggers like "discussion labeled question".

The schema needs to be updated to add a names field definition to the discussion event properties, similar to how it's defined for issues (lines 573-590) and pull_request (lines 482-499) events.

Copilot uses AI. Check for mistakes.
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