php-actions / composer

Use the Composer CLI in your Github Actions.
175 stars 54 forks source link

Unable to run exec command due to --no-interaction flag #60

Closed JasonTheAdams closed 3 years ago

JasonTheAdams commented 3 years ago

Greetings!

I'm trying to run the following wp-cli command:

      - name: Install composer dependencies and generate pot file
        uses: php-actions/composer@v5
        with:
          command: exec wp i18n make-pot ${{github.workspace}} ${{github.workspace}}/languages/give.pot

The command fails, however, as the --no-interaction flag:

Command: composer exec wp i18n make-pot /home/runner/work/givewp/givewp /home/runner/work/givewp/givewp/languages/give.pot --no-interaction
Error: Process completed with exit code 1.

I suspect the assumption is that the command is a native composer command, and not the exec command. So an exception probably needs to be made for the exec command to not add any additional flags.

g105b commented 3 years ago

Thanks for reporting this, I'll take a look later.

My plan is to recreate your requirements in https://GitHub.com/php-actions/example-composer so I can use that repository as future documented proof of the feature working.

g105b commented 3 years ago

Maybe your requirements would be satisfied by the only_args input or by toggling the interaction Boolean?

JasonTheAdams commented 3 years ago

I actually ended up realizing I need to run more than one wp-cli command, so I broke out into its own step. I'm afraid that I didn't test the only_args option, but that looks like it would've done the trick. Feel free to close this if you feel it's resolved.

g105b commented 3 years ago

If you have any follow up questions, I'm happy to answer. Have fun!