Skip to content

Commit

Permalink
Update action to allow composer to access multiple private repositori…
Browse files Browse the repository at this point in the history
…es using secret
  • Loading branch information
mattgrul committed Feb 25, 2024
1 parent d801c74 commit c47af75
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
description: 'The version of PHP to use.'
required: false
default: '8.3'
composer-token:
description: 'Token for Composer authentication.'
required: false
default: ''
composer-version:
description: 'The version of Composer to use.'
required: false
Expand Down Expand Up @@ -44,15 +48,22 @@ runs:
using: 'composite'
steps:
- id: setup-php
name: 'Setup PHP'
name: 'Setup PHP'.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
tools: composer:${{ inputs.composer-version }}
coverage: none

- id: configure-composer
if: ${{ inputs.composer-token != '' }}
name: 'Configure Composer GitHub Token'
run: composer config --global --auth github-oauth.github.com ${{ inputs.composer-token }}
shell: bash

- id: configure-composer-null
if: ${{ inputs.composer-token == '' }}
name: 'Alternative Default Composer GitHub Token'
run: composer config --global --auth github-oauth.github.com ${{ github.token }}
shell: bash

Expand Down

0 comments on commit c47af75

Please sign in to comment.