Set COMPOSER_NO_INTERACTION=1

Use composer.env file for configuring composer

Add a note about composer configuration to the README
This commit is contained in:
Shivam Mathur 2021-12-26 15:10:26 +05:30
parent da0e854737
commit d78b8a6d49
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
4 changed files with 5 additions and 2 deletions

View File

@ -300,6 +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`.
## :signal_strength: Coverage Support ## :signal_strength: Coverage Support

2
src/configs/composer.env Normal file
View File

@ -0,0 +1,2 @@
COMPOSER_PROCESS_TIMEOUT=0
COMPOSER_NO_INTERACTION=1

View File

@ -291,7 +291,7 @@ configure_composer() {
echo '{}' | tee "$composer_json" >/dev/null echo '{}' | tee "$composer_json" >/dev/null
chmod 644 "$composer_json" chmod 644 "$composer_json"
fi fi
composer -q config -g process-timeout 0 cat "${dist:?}"/../src/configs/composer.env >> "$GITHUB_ENV"
echo "$composer_bin" >>"$GITHUB_PATH" echo "$composer_bin" >>"$GITHUB_PATH"
if [ -n "$COMPOSER_TOKEN" ]; then if [ -n "$COMPOSER_TOKEN" ]; then
composer -q config -g github-oauth.github.com "$COMPOSER_TOKEN" composer -q config -g github-oauth.github.com "$COMPOSER_TOKEN"

View File

@ -327,7 +327,7 @@ Function Edit-ComposerConfig() {
if (-not(Test-Path $composer_json)) { if (-not(Test-Path $composer_json)) {
Set-Content -Path $composer_json -Value "{}" Set-Content -Path $composer_json -Value "{}"
} }
composer -q config -g process-timeout 0 Get-Content -Path $dist\..\src\configs\composer.env | Add-Content -Path $env:GITHUB_ENV
Write-Output $composer_bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 Write-Output $composer_bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
if (Test-Path env:COMPOSER_TOKEN) { if (Test-Path env:COMPOSER_TOKEN) {
composer -q config -g github-oauth.github.com $env:COMPOSER_TOKEN composer -q config -g github-oauth.github.com $env:COMPOSER_TOKEN