deployphp / action

GitHub Action for Deployer
MIT License
222 stars 44 forks source link

`options` is not working #72

Open Seb33300 opened 1 year ago

Seb33300 commented 1 year ago

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

Fund with Polar

Seb33300 commented 10 months ago

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
richardhj commented 2 weeks ago

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.