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

Allow to specify configuration argument as input #10

Closed
dmagnanimo opened this issue Nov 21, 2019 · 5 comments
Closed

Allow to specify configuration argument as input #10

dmagnanimo opened this issue Nov 21, 2019 · 5 comments
Labels
enhancement New feature or request
Milestone

Comments

@dmagnanimo
Copy link

dmagnanimo commented Nov 21, 2019

It will be best practice to insert configration argument as input.
Example:

steps:
  - name: Run the Cake script
    uses: ecampidoglio/cake-action@master
    with:
      configuration: Release
@dmagnanimo dmagnanimo changed the title Allow to specify arguments in target input Allow to specify configuration argument as input Nov 21, 2019
@ecampidoglio ecampidoglio added the enhancement New feature or request label Nov 25, 2019
@ecampidoglio ecampidoglio added this to the 1.2.0 milestone Mar 31, 2020
@ecampidoglio
Copy link
Member

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.

@dmagnanimo
Copy link
Author

The scriptArguments input parameter looks good indeed, for now I'll use one of the workaround you suggest. Thanks.

@jwickowski
Copy link

There is a pull request that will alow for that :)

#20

@ecampidoglio ecampidoglio linked a pull request Oct 13, 2020 that will close this issue
@ecampidoglio
Copy link
Member

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

@ecampidoglio
Copy link
Member

Resolved in 49c1c65.

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

Successfully merging a pull request may close this issue.

3 participants