Fix actionlint matched_command undefined in pre_activation outputs#17498
Fix actionlint matched_command undefined in pre_activation outputs#17498
matched_command undefined in pre_activation outputs#17498Conversation
|
@copilot keep working |
Always declare matched_command in pre_activation outputs so actionlint can resolve the type. For non-command workflows, emit empty string ''. For command workflows, reference the check_command_position step output. This fixes 37 actionlint type errors across 37 compiled workflow files where GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_MATCHED_COMMAND referenced needs.pre_activation.outputs.matched_command but the output was not declared in the pre_activation job. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done! Fixed in feec83d. Root cause: the compiler only emitted Fix: always declare Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
matched_command undefined in pre_activation outputs
|
@copilot merge main and recompile |
…t-matched-command-error
Done in 580576a. Merged Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Ensures pre_activation job outputs always declare matched_command so actionlint can type-check expressions that reference needs.pre_activation.outputs.matched_command.
Changes:
- Update the workflow compiler to always emit
matched_commandinpre_activationoutputs (''for non-command workflows). - Regenerate compiled
.lock.ymlworkflows to includematched_command: ''where applicable. - Update WASM golden fixtures to reflect the new
pre_activationoutputs shape.
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/compiler_activation_jobs.go | Always declares matched_command in pre_activation job outputs to avoid actionlint “undefined property” errors. |
| pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/with-imports.golden | Updates expected pre_activation.outputs to include matched_command: ''. |
| pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/smoke-copilot.golden | Updates expected pre_activation.outputs to include matched_command: ''. |
| pkg/workflow/testdata/wasm_golden/TestWasmGolden_CompileFixtures/basic-copilot.golden | Updates expected pre_activation.outputs to include matched_command: ''. |
| .github/workflows/workflow-health-manager.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/workflow-generator.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/ubuntu-image-analyzer.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/smoke-test-tools.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/smoke-temporary-id.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/smoke-project.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/smoke-multi-pr.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/smoke-gemini.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/smoke-copilot.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/smoke-copilot-arm.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/smoke-codex.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/smoke-claude.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/smoke-agent.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/slide-deck-maintainer.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/release.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/refiner.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/metrics-collector.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/issue-monster.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/firewall-escape.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/example-custom-error-patterns.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/dev-hawk.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/dependabot-burner.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/daily-testify-uber-super-expert.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/daily-team-status.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/daily-safe-output-optimizer.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/daily-rendering-scripts-verifier.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/daily-observability-report.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/daily-issues-report.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/daily-file-diet.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/code-simplifier.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/code-scanning-fixer.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/ci-doctor.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/changeset.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/breaking-change-checker.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/auto-triage-issues.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/ai-moderator.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/agent-persona-explorer.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
| .github/workflows/agent-performance-analyzer.lock.yml | Regenerated compiled workflow to declare matched_command: '' in pre_activation outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Always declare matched_command output so actionlint can resolve the type. | ||
| // For command workflows, reference the check_command_position step output. | ||
| // For non-command workflows, emit an empty string so the output key is defined. | ||
| if len(data.Command) > 0 { | ||
| outputs[constants.MatchedCommandOutput] = fmt.Sprintf("${{ steps.%s.outputs.%s }}", constants.CheckCommandPositionStepID, constants.MatchedCommandOutput) | ||
| } else { | ||
| outputs[constants.MatchedCommandOutput] = "''" | ||
| } |
There was a problem hiding this comment.
The new behavior (always declaring matched_command even when data.Command is empty) isn’t covered by unit tests. All existing buildPreActivationJob tests set Command, so a regression could reintroduce the actionlint error for non-command workflows. Add a test case that builds a pre-activation job with Command: nil/empty and asserts job.Outputs includes matched_command with an empty-string YAML literal (and does not reference steps.check_command_position).
matched_commandonly for slash-command workflows, butknown_needs_expressions.goalways references itcompiler_activation_jobs.go: always emitmatched_commandinpre_activationoutputs (''for non-command, step output for command workflows)matched_command: ''in expected pre_activation outputsmake recompile— 157/157 workflows compiled successfullyorigin/maininto branchTestPreActivation*,TestSlashCommand*,TestKnownNeeds*,TestWasmGolden*)Original prompt
matched_commandundefined inpre_activationoutputs for 37 workflows #17494🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.