Skip to content

Conversation

@reflexxion
Copy link
Contributor

@reflexxion reflexxion commented Sep 4, 2020

Using the php-actions/composer@v2 action for other commands than install or update will currently make it hard configuring the desired action.

To e.g. call the dump-autoload command it is currently necessary to "enable" some options so that they won't be appended to the final composer call. (and fail otherwise because they aren't supported by some commands)
Like so:

            -  uses: php-actions/composer@v2
                with:
                    command: dump-autoload
                    dev: no
                    suggest: yes # We need to set this setting because --no-suggest will be appended otherwise and the command will fail
                    progress: yes # We need to set this setting because --no-progress will be appended otherwise and the command will fail
                    args: --classmap-authoritative

To easily configure this options I've implemented an only_args argument which will disable all other action arguments.
So the desired dump-autoload command can be generated by:

            -  uses: php-actions/composer@v2
                with:
                    command: dump-autoload
                    only_args: --no-dev --no-interaction --classmap-authoritative

@g105b
Copy link
Member

g105b commented Sep 4, 2020

Hi @reflexxion ,

Thanks so much for your first contribution to this repo. I see the problem you've outlined and will test out your PR in the Example Composer repository to see that it works under some circumstances.

Great to have you on board!

reflexxion added a commit to reflexxion/example-composer that referenced this pull request Sep 7, 2020
@g105b g105b merged commit 419b69d into php-actions:master Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants