File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,12 +64,26 @@ runs:
6464 echo "System PHP Version: ${{ steps.read-system-php-version.outputs.php_version }}"
6565 if [ "${{ steps.read-php-version.outputs.php_version }}" != "" ] && [ "${{ steps.read-php-version.outputs.php_version }}" != "${{ steps.read-system-php-version.outputs.php_version }}" ]; then
6666 echo "Switching PHP version to ${{ steps.read-php-version.outputs.php_version }}"
67+ echo "keep_system_php=false" >> $GITHUB_OUTPUT
6768 else
6869 echo "Keeping system PHP version ${{ steps.read-system-php-version.outputs.php_version }}"
70+ echo "keep_system_php=true" >> $GITHUB_OUTPUT
71+ fi
72+
73+ - id : detect-if-apt-present
74+ name : " Detect if apt is present"
75+ shell : bash
76+ run : |
77+ if command -v apt-get > /dev/null 2>&1; then
78+ echo "apt-get exists"
79+ echo "apt_exists=true" >> $GITHUB_OUTPUT
80+ else
81+ echo "apt-get does not exist"
82+ echo "apt_exists=false" >> $GITHUB_OUTPUT
6983 fi
7084
7185 - uses : shivammathur/setup-php@v2
72- if : ${{ steps.read-system- php-version.outputs.php_version != '' || steps.read-php-version .outputs.php_version != steps.read-system-php-version.outputs.php_version }}
86+ if : ${{ steps.decide- php-version.outputs.keep_system_php == 'false' && steps.detect-if-apt-present .outputs.apt_exists == 'true' }}
7387 with :
7488 php-version : ${{ steps.read-php-version.outputs.php_version }}
7589 tools : ${{ inputs.php_tools }}
You can’t perform that action at this time.
0 commit comments