From d3610b8364090ed4d9b7afd7f55533074685a6e8 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sat, 18 May 2024 18:28:18 +0200 Subject: [PATCH] Output PHP_VERSION as an env too. --- README.md | 10 ++++++++++ action.yml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index c8eb87a..a730809 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file diff --git a/action.yml b/action.yml index 7e075d2..20a57e7 100644 --- a/action.yml +++ b/action.yml @@ -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