actions-gh-pages
actions-gh-pages copied to clipboard
Consider adding a programmatic API
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!
Thank you for suggesting this!
Yes. I was considering this in my mind. The previous works on JasonEtco/actions-toolkit and actions/toolkit will probably be a good reference for us.
In addition, I am also maintaining other actions like:
- peaceiris/actions-hugo
- peaceiris/actions-mdbook
- peaceiris/actions-label-commenter
- and others I will create...
Shared functions and methods with those projects are also useful.
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).
I agree with this that is one of the important things for users.
GitHub published their
@actions/cache
action so other actions could use it without users requiring addinguses: @actions/cache
step.
I was watching this process. It will be also helpful for our cases.
This week and next week are examination weeks for me. I will work on this and other issues from the next weekend.
#87 #103 #163 #164 #165 #242 #245 #273 #309 #324 and #300