diff --git a/.github/oxid-esales/defaults/defaults_light.yaml b/.github/oxid-esales/defaults/defaults_light.yaml index 277f069e..73b1d9fb 100644 --- a/.github/oxid-esales/defaults/defaults_light.yaml +++ b/.github/oxid-esales/defaults/defaults_light.yaml @@ -123,6 +123,9 @@ global: # Options for composer update update_options: '--no-interaction' + # Composer version (e.g., 2.8.12). Empty = use docker image default + version: '' + # This grep pattern is applied to the generated phpunit, Codeception, and runtest log file. If we have # a hit matching the pattern below, the step will fail. failure_pattern: | diff --git a/.github/workflows/universal_workflow_light.yaml b/.github/workflows/universal_workflow_light.yaml index 12f1b322..2669a2d8 100644 --- a/.github/workflows/universal_workflow_light.yaml +++ b/.github/workflows/universal_workflow_light.yaml @@ -324,6 +324,7 @@ jobs: composer_update: ${{ steps.iltp.outputs.install_composer_update}} composer_update_options: ${{ steps.iltp.outputs.install_composer_update_options}} composer_dev_ref: ${{ steps.iltp.outputs.install_composer_dev_ref}} + composer_version: ${{ steps.iltp.outputs.install_composer_version }} enterprise_github_token: ${{ secrets.enterprise_github_token || github.token }} copy_script_targets: ${{ steps.iltp.outputs.install_copy_script_targets }} debug: ${{ needs.init.outputs.debug }} diff --git a/docs/actions/prepare_shop.md b/docs/actions/prepare_shop.md index 082da6a7..1b26364c 100644 --- a/docs/actions/prepare_shop.md +++ b/docs/actions/prepare_shop.md @@ -91,6 +91,11 @@ Options to pass along to composer during installation. **composer_dev_ref:** *not required*, *default:* 'dev-b-8.0.x' Development package reference. +**composer_version:** *not required*, *default:* `''` +Composer version (e.g., '2.8.12'). When specified, runs `composer self-update` +to set the desired version before any composer commands. Leave empty to use the +default version from the Docker image. + **enterprise_github_token:** *not required*, *default:* `''` OAuth token to access enterprise repos. This should be populated with \${{ secrets.enterprise_github_token }} and will be hidden by GitHub. diff --git a/prepare_shop/action.yaml b/prepare_shop/action.yaml index 0e7e5cf9..ca09a237 100644 --- a/prepare_shop/action.yaml +++ b/prepare_shop/action.yaml @@ -138,6 +138,11 @@ inputs: required: false description: 'OAuth token to access enterprise repos' default: '' + composer_version: + type: string + required: false + description: 'Composer version (e.g., 2.8.12). Empty = use docker image default' + default: '' docker_login: type: boolean required: false @@ -310,6 +315,19 @@ runs: ${{ inputs.container_name}} \ composer config -g github-oauth.github.com "${{ inputs.enterprise_github_token }}" + - name: 'Set Composer version' + if: ${{ inputs.composer_version != '' }} + shell: bash + run: | + # prepare_shop: Set Composer version + ${{ inputs.debug }} + echo -e "\033[0;35mSetting Composer to version ${{ inputs.composer_version }}\033[0m" + docker compose ${{ inputs.container_method }} -T \ + -u root \ + ${{ inputs.container_options }} \ + ${{ inputs.container_name }} \ + composer self-update ${{ inputs.composer_version }} + - name: 'Modify composer.json' if: ${{ inputs.composer_transform != '' }} uses: 'OXID-eSales/github-actions/composer_merge@v5'