Objective
Modify the workflow compiler to generate references to custom actions instead of embedding JavaScript inline via actions/github-script.
Context
The compiler currently uses DefaultScriptRegistry and bundling to embed JavaScript. We need to add a mode where it emits uses: references to custom actions instead.
Approach
- Add a compilation mode flag (e.g.,
--action-mode=custom|inline)
- Update
pkg/workflow/compiler.go to support custom action references
- Modify step generation to emit:
# Development mode
- uses: ./actions/check-membership
# Release mode (to be implemented in separate task)
- uses: githubnext/gh-aw/.github/actions/check-membership@SHA
- Update
script_registry.go to support mapping script names to action paths
- Add tests for both inline and custom action modes
Files to Modify
pkg/workflow/compiler.go
pkg/workflow/script_registry.go
pkg/workflow/bundler.go (if needed)
- Add tests:
pkg/workflow/compiler_custom_actions_test.go
Acceptance Criteria
AI generated by Plan Command for #5946
Objective
Modify the workflow compiler to generate references to custom actions instead of embedding JavaScript inline via
actions/github-script.Context
The compiler currently uses
DefaultScriptRegistryand bundling to embed JavaScript. We need to add a mode where it emitsuses:references to custom actions instead.Approach
--action-mode=custom|inline)pkg/workflow/compiler.goto support custom action referencesscript_registry.goto support mapping script names to action pathsFiles to Modify
pkg/workflow/compiler.gopkg/workflow/script_registry.gopkg/workflow/bundler.go(if needed)pkg/workflow/compiler_custom_actions_test.goAcceptance Criteria
./actions/...)Related to [plan] Refactor compiler to use custom actions for JavaScript code #5947