How to send a docker arg depending on a input value


I have created this github action, Dependency-Check_Action/action.yml at 75ba02d6183445fe0761d26e836bde58b1560600 · dependency-check/Dependency-Check_Action · GitHub, and i want to do an amendment that i dont know if is possible to do.

I want to add a new parameter, called disableYarnAudit, which will be a boolean. When it is true, i want to send in the run args a value.

So basically i want to send as args

  • ‘–disableYarnAudit’ when the input field disableYarnAudit is set to true

Can i add a condition when setting run arguments?


Not directly. What you could do would be to add your own Dockerfile based on the image you’re currently using directly, and add a custom script as the entrypoint. That script could then assemble the command line as you want it based on the inputs, and exec into the original entrypoint.

Thanks. Another question, and i fear its another no… Is there any way to send an array or a list of values to an input parameter?

I’m not aware of any. The Docker Action gets the input as text, so the closest you could do would be to have some text that can be parsed to an array (e.g. JSON).