action icon indicating copy to clipboard operation
action copied to clipboard

`options` is not working

Open Seb33300 opened this issue 2 years ago • 2 comments

The options input provided in the README is not working:

  - name: Deploy
    uses: deployphp/action@v1
    with:

      # Config options for the Deployer. Same as the `-o` flag in the CLI.
      # Optional.
      options:
        keep_releases: 7

When trying to use it, i have a syntax error message.

I also tried this syntax: no error, but options are ignored.

      options: |
        keep_releases: 7

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Seb33300 avatar Jun 28 '23 08:06 Seb33300

If this can help, a workaround for this is to use the dep and pass options to the command line:

  - uses: deployphp/action@v1
    with:
    dep: deploy host_name -o branch=main -o keep_releases=7

Seb33300 avatar Sep 13 '23 02:09 Seb33300

Github's action.yaml schema do not allow array-like input variables. Only scalars, not even booleans.

This is why

      options:
        keep_releases: 7

does not work.

This could work

      options: |
        keep_releases: 7

because it gets interpreted as string. But the key: value string then must get processed within the action --> here: https://github.com/deployphp/action/blob/280404946f8c7f7967b1c5d4615316f265df4833/index.js#L118


IMHO using deploy host_name -o branch=main -o keep_releases=7 is just fine, no need for the options config. I would also vote for deprecating it.

richardhj avatar Jun 30 '24 11:06 richardhj