From 214e0e6b7a028a68429c90a223a4bf7642db63ec Mon Sep 17 00:00:00 2001 From: mattgrul <40339403+mattgrul@users.noreply.github.com> Date: Fri, 23 Feb 2024 20:21:19 +0000 Subject: [PATCH] Update action to allow composer to access multiple private repositories using secret --- action.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index ea7a224..111c9dc 100644 --- a/action.yml +++ b/action.yml @@ -11,6 +11,9 @@ inputs: description: 'The version of PHP to use.' required: false default: '8.3' + composer-token: + description: 'Token for Composer authentication.' + required: false composer-version: description: 'The version of Composer to use.' required: false @@ -44,7 +47,7 @@ runs: using: 'composite' steps: - id: setup-php - name: 'Setup PHP' + name: 'Setup PHP'. uses: shivammathur/setup-php@v2 with: php-version: ${{ inputs.php-version }} @@ -53,7 +56,12 @@ runs: - id: configure-composer name: 'Configure Composer GitHub Token' - run: composer config --global --auth github-oauth.github.com ${{ github.token }} + run: | + if [ -n "${{ inputs.composer-token }}" ]; then + composer config --global --auth github-oauth.github.com ${{ github.token }} + elif + composer config --global --auth github-oauth.github.com ${{ inputs.composer-token }} + fi shell: bash - id: download-satis