Skip to content

Commit

Permalink
feat: Get PHP version from .php-version file if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
nlemoine committed Nov 14, 2024
1 parent cf8e78b commit 4c18fd0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/composer-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,21 @@ jobs:
fetch-depth: 0
ref: main

# Set PHP version as an environment variable
- name: Set PHP version
run: |
if [ -f .php-version ]; then
CURRENT_PHP_VERSION=$(cat .php-version)
else
CURRENT_PHP_VERSION=${{ inputs.PHP_VERSION }}
fi
echo "PHP_VERSION=$CURRENT_PHP_VERSION" >> "$GITHUB_ENV"
- name: Composer setup
uses: Humanoidfr/humanoid-github-workflows/.github/actions/composer@main
with:
PHP_VERSION: ${{ inputs.PHP_VERSION }}
PHP_VERSION: ${{ env.PHP_VERSION }}
COMPOSER_CONFIG: ${{ vars.COMPOSER_CONFIG_JSON }}
INSTALL_AND_CACHE: false

Expand Down

0 comments on commit 4c18fd0

Please sign in to comment.