Skip to content

Consider adding a programmatic API #344

Open
@sidvishnoi

Description

@sidvishnoi

Is your feature request related to a problem? Please describe

In some organizations, workflows have a lot of common custom steps across repositories/workflows. To ease with this, people create custom actions that wrap some of the other common actions so users don't have to copy-paste and update them manually across all workflows. Custom actions require access to programmatic API.

Describe the solution you'd like

Consider publishing this action to npm so it can be used programmatically.

It'll require a little refactoring. I propose requiring Input as an argument to run in main.js:

export async function run(inps: Inputs) {...}

The inputs can be passed to run in index.js, exposing an API from main.js (It might make sense to swap these file names - imports will become simpler).

Also, all @actions/* packages and other dependencies should probably not be bundled in the package, so they can be reused by other actions without duplication (tree shaking, if you will).

Describe alternatives you've considered

  • Clone and build the project in custom action to use the utils and instead of run() - which sucks.
  • Change the content of get-inputs.ts on clone with custom logic.

Additional context

GitHub published their @actions/cache action so other actions could use it without users requiring adding uses: @actions/cache step.

Thank you for creating such wonderful project!

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions