Single yaml file Github Actions

Is there a way where you can use a single .yml file that was originally a workflow main.yml, that uses external actions, bash and node.js to create an action in itself without any other external dependencies? The goal was to create a single file tool that can be both run as an action or dumped into a repo and work as a workflow from there.

I’m fairly new to this and maybe missed something in documentation.

@MikhailTH ,

You can try to setup a Composite run steps action.
The composite action is a type of actions, the other two types are Docker container action and JavaScript action.

You can combine multiple workflow run steps within a composite action. However, it only can combine run steps, the uses steps to run other actions are not supported.

More details about creating composite action, you can see “Creating a composite run steps action”.

1 Like

Yeah my action has both JS and a Bash shell running in it, I’m guessing that isn’t supported yet?

Edit:
Any way around it other than having to call individual scripts from the repo?

@MikhailTH ,

Currently, we do have any available way that setup an action or reuse workflow to combine some run steps and uses steps.

  • As mentioned above, the composite action can only combine run steps.
  • Unlike the YAML Pipelines of Azure Pipelines supports reusable Templates, currently, GitHub does not support to reuse workflow.

If you really need the similar features, I recommend that you can directly report a feature request here. That will allow you to directly interact with the appropriate engineering team, and make it more convenient for the engineering team to collect and categorize your suggestions.

2 Likes