Closed dmagnanimo closed 4 years ago
Parameters like configuration
don't belong to Cake itself, but rather are defined in the particular Cake script that you're running.
While we could add support for the most commonly used arguments (like configuration
), I would rather implement a way to pass custom arguments from the workflow to the Cake script.
Ideally, we'd define an input parameter called scriptArguments
that accepts a YAML sequence, so we can say:
steps:
- name: Run the Cake script
uses: cake-contrib/cake-action@v1
with:
scriptArguments:
- configuration: Release
- someOtherParameter: value
- whyNotASwitch: true
Sounds good right? But here's the problem: actions don't support sequences as inputs, or anything other than string
, really. 😞
The current workaround is to define a custom format for lists and parse that manually. Some use embedded JSON, while others simply define each input in a new line.
I'm looking into both solutions while watching actions/toolkit#184 closely.
The scriptArguments
input parameter looks good indeed, for now I'll use one of the workaround you suggest. Thanks.
There is a pull request that will alow for that :)
Until it's possible to parse input arguments as lists, you can pass the configuration
parameter to your Cake script by using the new arguments
input:
steps:
- name: Run the Cake script
uses: cake-build/cake-action@master
with:
arguments: |
configuration: Release
Resolved in 49c1c65.
It will be best practice to insert configration argument as input. Example: