From d78b8a6d49a7af0bc024b01847972e374a6b20ad Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sun, 26 Dec 2021 15:10:26 +0530 Subject: [PATCH] Set COMPOSER_NO_INTERACTION=1 Use composer.env file for configuring composer Add a note about composer configuration to the README --- README.md | 1 + src/configs/composer.env | 2 ++ src/scripts/common.sh | 2 +- src/scripts/win32.ps1 | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 src/configs/composer.env diff --git a/README.md b/README.md index ce882689..c34ccb85 100644 --- a/README.md +++ b/README.md @@ -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. - 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. +- By default, `COMPOSER_NO_INTERACTION` is set to `1` and `COMPOSER_PROCESS_TIMEOUT` is set to `0`. ## :signal_strength: Coverage Support diff --git a/src/configs/composer.env b/src/configs/composer.env new file mode 100644 index 00000000..f535d215 --- /dev/null +++ b/src/configs/composer.env @@ -0,0 +1,2 @@ +COMPOSER_PROCESS_TIMEOUT=0 +COMPOSER_NO_INTERACTION=1 diff --git a/src/scripts/common.sh b/src/scripts/common.sh index 5c8e3a21..300f3eeb 100644 --- a/src/scripts/common.sh +++ b/src/scripts/common.sh @@ -291,7 +291,7 @@ configure_composer() { echo '{}' | tee "$composer_json" >/dev/null chmod 644 "$composer_json" fi - composer -q config -g process-timeout 0 + cat "${dist:?}"/../src/configs/composer.env >> "$GITHUB_ENV" echo "$composer_bin" >>"$GITHUB_PATH" if [ -n "$COMPOSER_TOKEN" ]; then composer -q config -g github-oauth.github.com "$COMPOSER_TOKEN" diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index 52fa10ff..5f479d5e 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -327,7 +327,7 @@ Function Edit-ComposerConfig() { if (-not(Test-Path $composer_json)) { 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 if (Test-Path env:COMPOSER_TOKEN) { composer -q config -g github-oauth.github.com $env:COMPOSER_TOKEN