deployphp / action

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

Remove --ansi flag #41

Closed andyexeter closed 1 year ago

andyexeter commented 1 year ago

This PR removes the --ansi flag from the deploy command.

With ansi enabled, errors in actions when using dark mode on GitHub are garish and blinding. Passing --no-ansi to the dep option doesn't work, presumably because the --ansi flag comes before it.

By removing it, it can be left to the developer to explicitly enable or disable it within the dep option, e.g:

with:
  dep: deploy --no-ansi

Or

with:
  dep: deploy --ansi
antonmedv commented 1 year ago

I didn't get it. Can you show screenshots? Can it be issue with how github renders?

andyexeter commented 1 year ago

Sure, here's a sample screenshot of an error during the deployment process:

Screenshot 2022-08-16 at 23 15 38

It looks like this even when I pass --no-ansi as part of the dep option - presumably because the Symfony Console component gets confused when given both --ansi and --no-ansi and ignores the latter.

If you don't want to change the existing behaviour, could we perhaps add an 'ansi' option to the the action which defaults to true, and pass --ansi or --no-ansi depending on its value?

antonmedv commented 1 year ago

If two flags are passed, later is taking more precedence?

andyexeter commented 1 year ago

I don't think the order matters. If --ansi is passed, --no-ansi is always ignored. You can test this with dep list, e.g:

dep list --no-ansi
dep list --ansi --no-ansi
dep list --no-ansi --ansi

The first one correctly disables ANSI output. the last two ignore --no-ansi and display ANSI output.

antonmedv commented 1 year ago

Hmm, I’d like to keep ansi by default.

Maybe we can change color of error reporting. Adding black foreground color.

andyexeter commented 1 year ago

Superseded by #42