Loading templates/gitlab-ci-python.yml +17 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,11 @@ variables: echo -e "[\\e[1;91mERROR\\e[0m] $*" } function fail() { log_error "$*" exit 1 } function assert_defined() { if [[ -z "$1" ]] then Loading Loading @@ -836,6 +841,18 @@ variables: fi } function github_get_latest_version() { if command -v curl &> /dev/null then curl -sSf -I "https://github.com/$1/releases/latest" | awk -F '/' '/location:/ {print $NF}' elif command -v python3 &> /dev/null then python3 -c "import urllib.request;url='https://github.com/$1/releases/latest';opener=urllib.request.build_opener(type('NoRedirection', (urllib.request.HTTPErrorProcessor,), {'http_response': lambda self, req, resp: resp, 'https_response': lambda self, req, resp: resp})());req=urllib.request.Request(url, method='HEAD');print(opener.open(req).headers.get('Location').split('/')[-1])" else fail "curl or python3 required" fi } unscope_variables eval_all_secrets Loading Loading
templates/gitlab-ci-python.yml +17 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,11 @@ variables: echo -e "[\\e[1;91mERROR\\e[0m] $*" } function fail() { log_error "$*" exit 1 } function assert_defined() { if [[ -z "$1" ]] then Loading Loading @@ -836,6 +841,18 @@ variables: fi } function github_get_latest_version() { if command -v curl &> /dev/null then curl -sSf -I "https://github.com/$1/releases/latest" | awk -F '/' '/location:/ {print $NF}' elif command -v python3 &> /dev/null then python3 -c "import urllib.request;url='https://github.com/$1/releases/latest';opener=urllib.request.build_opener(type('NoRedirection', (urllib.request.HTTPErrorProcessor,), {'http_response': lambda self, req, resp: resp, 'https_response': lambda self, req, resp: resp})());req=urllib.request.Request(url, method='HEAD');print(opener.open(req).headers.get('Location').split('/')[-1])" else fail "curl or python3 required" fi } unscope_variables eval_all_secrets Loading