Output PHP_VERSION as an env too.

This commit is contained in:
Greyscale 2024-05-18 18:28:18 +02:00
parent 8635216376
commit d3610b8364
2 changed files with 20 additions and 0 deletions

View file

@ -1,2 +1,12 @@
# action-setup-php
Sets up a PHP project with GitHub Actions, including detecting PHP version and running composer install.
## Inputs:
- `working_directory`: The directory to run the PHP setup in. Default: `.`.
- `php_tools`: The PHP tools to install.
## Outputs:
- `php_version`: The PHP version that was detected.
## Exported Envs:
- `PHP_VERSION`: The PHP version that was detected.

View file

@ -53,4 +53,14 @@ runs:
with:
path: ${{ steps.composer-cache-find.outputs.dir }}
key: ${{ steps.composer-cache-find.outputs.key }}
- shell: bash
run: |
echo "PHP Version: ${{ steps.read-php-version.outputs.php_version }}"
echo "PHP Tools: ${{ inputs.php_tools }}"
echo "Composer Cache Dir: ${{ steps.composer-cache-find.outputs.dir }}"
echo "Composer Cache Key: ${{ steps.composer-cache-find.outputs.key }}"
echo "Composer Cache Restore Key: ${{ steps.composer-cache-find.outputs.restore-key }}"
{
echo "PHP_VERSION=${{ steps.read-php-version.outputs.php_version }}"
} >> $GITHUB_ENV