Example code: remove --no-interaction from Composer commands

All Composer commands used in CI should use `--no-interaction` to prevent them hanging in case interaction is expected. However, as setupPHP sets the `COMPOSER_NO_INTERACTION` flag (as of this version), this is not needed when using setupPHP.

This removes redundant `--no-interaction` arguments from the example code.

Also see: https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution
This commit is contained in:
jrfnl 2021-12-26 20:43:07 +01:00 committed by Shivam Mathur
parent d78b8a6d49
commit bca2d0b1b0
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
4 changed files with 4 additions and 4 deletions

View File

@ -300,7 +300,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
- Input `tools` is useful to set up tools which you only use in GitHub Actions, thus keeping your `composer.json` tidy. - Input `tools` is useful to set up tools which you only use in GitHub Actions, thus keeping your `composer.json` tidy.
- If you do not want to use all your dev-dependencies in GitHub Actions workflow, you can run composer with `--no-dev` and install required tools using `tools` input to speed up your workflow. - If you do not want to use all your dev-dependencies in GitHub Actions workflow, you can run composer with `--no-dev` and install required tools using `tools` input to speed up your workflow.
- If you have a tool in your `composer.json`, do not set up it with `tools` input as the two instances of the tool might conflict. - If you have a tool in your `composer.json`, do not set up it with `tools` input as the two instances of the tool might conflict.
- By default, `COMPOSER_NO_INTERACTION` is set to `1` and `COMPOSER_PROCESS_TIMEOUT` is set to `0`. - By default, `COMPOSER_NO_INTERACTION` is set to `1` and `COMPOSER_PROCESS_TIMEOUT` is set to `0`. In effect, this means that Composer commands in your scripts do not need to specify `--no-interaction`.
## :signal_strength: Coverage Support ## :signal_strength: Coverage Support

View File

@ -57,7 +57,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
composer install --no-progress --prefer-dist --optimize-autoloader composer install --no-progress --prefer-dist --optimize-autoloader
composer run-script post-install-cmd --no-interaction composer run-script post-install-cmd
# Add a step to run migrations if required # Add a step to run migrations if required
- name: Test with phpunit - name: Test with phpunit

View File

@ -54,7 +54,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
composer install --no-progress --prefer-dist --optimize-autoloader composer install --no-progress --prefer-dist --optimize-autoloader
composer run-script post-install-cmd --no-interaction composer run-script post-install-cmd
# Add a step to run migrations if required # Add a step to run migrations if required
- name: Test with phpunit - name: Test with phpunit

View File

@ -37,7 +37,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
composer install --no-progress --prefer-dist --optimize-autoloader composer install --no-progress --prefer-dist --optimize-autoloader
composer run-script post-install-cmd --no-interaction composer run-script post-install-cmd
- name: Test with phpunit - name: Test with phpunit
run: vendor/bin/phpunit --coverage-text run: vendor/bin/phpunit --coverage-text