CI: Improve reusable 'install' action
This commit is contained in:
parent
23b00ba1e0
commit
b9de38f7f2
1 changed files with 2 additions and 15 deletions
17
.github/actions/install/action.yml
vendored
17
.github/actions/install/action.yml
vendored
|
@ -30,24 +30,11 @@ runs:
|
|||
run: |
|
||||
COMPOSER_ROOT_VERSION=
|
||||
|
||||
COMPOSER_BRANCH_ALIAS="$(php -r "
|
||||
\$json = json_decode(file_get_contents('./composer.json'), true);
|
||||
if (\$json !== null) {
|
||||
if (isset(\$json['extra']['branch-alias']['dev-$GITHUB_REF_NAME'])) {
|
||||
echo 'dev-$GITHUB_REF_NAME';
|
||||
}
|
||||
}
|
||||
")"
|
||||
|
||||
if [ -z "$COMPOSER_BRANCH_ALIAS" ]; then
|
||||
PICO_VERSION_PATTERN="$(php -r "
|
||||
if [ -z "$(composer config extra.branch-alias."dev-$GITHUB_REF_NAME")" ]; then
|
||||
COMPOSER_ROOT_VERSION="$(php -r "
|
||||
require('./lib/Pico.php');
|
||||
echo preg_replace('/\.[0-9]+-dev$/', '.x-dev', Pico::VERSION);
|
||||
")"
|
||||
fi
|
||||
|
||||
if [ -n "$PICO_VERSION_PATTERN" ]; then
|
||||
COMPOSER_ROOT_VERSION="$PICO_VERSION_PATTERN"
|
||||
echo "COMPOSER_ROOT_VERSION=$COMPOSER_ROOT_VERSION" | tee -a "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue