mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-26 13:23:05 +07:00
Update PHP if ppa:ondrej/php is missing ref: actions/runner-images#6331
This commit is contained in:
parent
388883d4bf
commit
5178fac634
@ -140,6 +140,20 @@ add_list() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to check if a PPA exists
|
||||||
|
check_ppa() {
|
||||||
|
ppa=$1
|
||||||
|
ppa_url=${2:-"$lp_ppa/$ppa/ubuntu"}
|
||||||
|
package_dist=${3:-"$VERSION_CODENAME"}
|
||||||
|
branches=${4:-main}
|
||||||
|
ppa_search="deb .*$ppa_url $package_dist .*$branches"
|
||||||
|
if check_lists "$ppa" "$ppa_search"; then
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Function to remove a PPA.
|
# Function to remove a PPA.
|
||||||
remove_list() {
|
remove_list() {
|
||||||
ppa=${1-ondrej/php}
|
ppa=${1-ondrej/php}
|
||||||
|
@ -56,15 +56,20 @@ read_env() {
|
|||||||
[[ -z "${ImageOS}" && -z "${ImageVersion}" ]] && _runner=self-hosted || _runner=github
|
[[ -z "${ImageOS}" && -z "${ImageVersion}" ]] && _runner=self-hosted || _runner=github
|
||||||
runner="${runner:-${RUNNER:-$_runner}}"
|
runner="${runner:-${RUNNER:-$_runner}}"
|
||||||
|
|
||||||
export fail_fast
|
|
||||||
export runner
|
|
||||||
export update
|
|
||||||
export ts
|
|
||||||
|
|
||||||
if [[ "$runner" = "github" && $_runner = "self-hosted" ]]; then
|
if [[ "$runner" = "github" && $_runner = "self-hosted" ]]; then
|
||||||
fail_fast=true
|
fail_fast=true
|
||||||
add_log "$cross" "Runner" "Runner set as github in self-hosted environment"
|
add_log "$cross" "Runner" "Runner set as github in self-hosted environment"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set Update to true if the ubuntu github image does not have PHP PPA.
|
||||||
|
if [[ "$runner" = "github" && "${ImageOS}" =~ ubuntu.* ]]; then
|
||||||
|
check_ppa ondrej/php || update=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
export fail_fast
|
||||||
|
export runner
|
||||||
|
export update
|
||||||
|
export ts
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to download a file using cURL.
|
# Function to download a file using cURL.
|
||||||
|
Loading…
Reference in New Issue
Block a user