Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call another github action like an async function call #1510

Open
rakeshramakrishnan-hbk opened this issue Sep 1, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@rakeshramakrishnan-hbk
Copy link

Describe the enhancement
Consider development of a composite GitHub action using the javascript toolkit. In that case, the steps would involve also calling other existing actions as if run from the action yaml.

Code Snippet
Something along the lines of:

import * as core from '@actions/core';

async function run() {
  await core.callAction("<name", {input_arg1: "v1", input_arg2: "v2", ...})

  // access any output from this action call by calling ??
}

Additional information
The idea is to be able to specify a composite action entirely in javascript. Given that a composite action is treated like a regular action, is there a way to create composite actions using the javascript SDK?

@rakeshramakrishnan-hbk rakeshramakrishnan-hbk added the enhancement New feature or request label Sep 1, 2023
@rakeshramakrishnan-hbk
Copy link
Author

Can see this being raised here too - #1458

@ljharb
Copy link

ljharb commented Nov 30, 2023

I would love this; I have an action written in JS that I want to extract a piece out of and move to a composite action - so I can use it in other actions. However, I still need the JS-written action to be able to use it, and I'm not sure if it's possible without this kind of feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants