diff --git a/.github/workflows/docker-dev.yml b/.github/workflows/docker-dev.yml index f374a7010..5b23d4762 100644 --- a/.github/workflows/docker-dev.yml +++ b/.github/workflows/docker-dev.yml @@ -45,11 +45,24 @@ jobs: KEEP_LAST_N_IMAGES: 5 run: | # Get list of tags - TAGS=$(curl -s -u $DOCKER_HUB_USERNAME:$DOCKER_HUB_PASSWORD https://hub.docker.com/v2/repositories/$DOCKER_HUB_REPO/tags/?page_size=100 | jq -r '.results[].name') + RESPONSE=$(curl -s -u $DOCKER_HUB_USERNAME:$DOCKER_HUB_PASSWORD -o /tmp/response.json -w "%{http_code}" https://hub.docker.com/v2/repositories/$DOCKER_HUB_REPO/tags/?page_size=100) + + # Check HTTP Status Code + if [ "$RESPONSE" -ne 200 ]; then + echo "Failed to fetch tags, HTTP Response code is $RESPONSE" + cat /tmp/response.json + exit 1 + fi + + # Check for null JSON Response and Extract Tags + TAGS=$(jq -r '.results? | if type=="array" then .[].name else empty end' /tmp/response.json) + + # Filter tags with "dev" + DEV_TAGS=$(echo "$TAGS" | grep dev) # Sort tags and delete all except for the most recent N COUNTER=0 - for TAG in $(echo $TAGS | tr " " "\n" | sort -V) + for TAG in $(echo $DEV_TAGS | tr " " "\n" | sort -V) do if [ $COUNTER -ge $KEEP_LAST_N_IMAGES ] then diff --git a/includes/xcal.php b/includes/xcal.php index 7312fe5c4..b805801f8 100644 --- a/includes/xcal.php +++ b/includes/xcal.php @@ -1962,6 +1962,10 @@ function curl_download($url) { function parse_ical ( $cal_file, $source = 'file' ) { global $errormsg, $importMd5, $tz; + // Replace instances of 'webcal://' with 'http://' since PHP's curl does not + // support it. + $cal_file = str_ireplace('webcal://', 'http://', $cal_file); + $importMd5 = ''; $ical_data = []; do_debug ( "in parse_ical, file=$cal_file, source=$source" );