Next Steps for Fully Functioning Composite Actions
Problem
NOTE: For those who are not aware, I'm a college student who interned at GitHub for Summer 2020. Thank you all for all the thoughtful comments and feedback on this thread but since I'm not working at GitHub currently, I will not be responding to any new comments below in this thread. ================================================ Hi there ๐ We just released a new feature called composite run steps actions(https://docs.github.com/en/actions/creating-actions/about-actions#composite-run-steps-actions). This issue thread will serve as a point of reference for people who are curious about the next steps after this feature and what we plan to work on next. There are probably quite a few questions about when we are going to support in the future like "when are you going to support 'uses' steps in a composite action"? In this Issue thread, I'll talk about the technical problems that we are planning to solve to accomplish this. Throughout the next week, I'll update it with any additional updates. tl;dr in this issue, I'll go over what we currently support for composite run steps and how we plan on developing fully functioning composite actions. Composite run steps background What is a composite run steps action? Many of you have been asking us to build a feature that enables them to nest actions within actions (ex: https://github.com/actions/runner/issues/438). An important first step for supporting nesting within action is to first start supporting the execution of multi
Error Output
error: * Workflow: https://github.com/ethanchewy/testing-actions/actions/runs/184580073/workflow
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Enhance Support for Nested Actions in Composite Run Steps
The current implementation of composite run steps actions does not support the execution of nested actions due to limitations in the action runner's architecture. This prevents users from utilizing 'uses' steps within composite actions, which is a desired feature for more complex workflows.
Awaiting Verification
Be the first to verify this fix
- 1
Assess Current Action Runner Capabilities
Review the existing action runner codebase to identify the limitations in supporting nested actions. Focus on the execution flow and how actions are currently invoked.
- 2
Implement 'uses' Step Support
Modify the action runner to allow 'uses' steps within composite actions. This involves updating the parsing logic to recognize and correctly execute nested actions.
javascriptconst { exec } = require('child_process'); function runNestedAction(actionPath) { exec(`action-runner ${actionPath}`, (error, stdout, stderr) => { if (error) { console.error(`Error executing action: ${stderr}`); return; } console.log(`Action output: ${stdout}`); }); } - 3
Update Documentation
Revise the official GitHub Actions documentation to include examples and guidelines on how to use nested actions within composite run steps. This will help users understand the new capabilities and best practices.
- 4
Conduct Testing
Create a series of test cases that cover various scenarios of using nested actions within composite run steps. Ensure that both successful executions and error handling are tested.
yamlname: Test Nested Actions on: [push] jobs: test: runs-on: ubuntu-latest steps: - name: Run Composite Action uses: ./path/to/composite-action with: param1: value1 param2: value2
Validation
Confirm the fix by creating a composite action that includes nested actions and running it in a GitHub workflow. Ensure that all steps execute successfully and that the output is as expected.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep