mirror of
https://github.com/humbletim/firestorm-gha.git
synced 2026-08-14 08:53:07 +00:00
gha ubuntu compat
This commit is contained in:
+13
-7
@@ -13,7 +13,8 @@ function gha-cache-exists() {(
|
||||
|
||||
local PATH="$PATH:/usr/bin"
|
||||
local node="${node:-/c/Program Files/nodejs/node}"
|
||||
local actions_cache_dir="${actions_cache_dir:-/d/a/_actions/actions/cache/v4}"
|
||||
local _actions="${_actions:-/d/a/_actions}"
|
||||
local actions_cache_dir="${actions_cache_dir:-$_actions/actions/cache/v4}"
|
||||
local script="${script:-${actions_cache_dir}/dist/restore-only/index.js}"
|
||||
|
||||
local -a Input=(
|
||||
@@ -219,10 +220,13 @@ function gha-cache-restore-fast() {(
|
||||
test -v GITHUB_ACTIONS || return 1
|
||||
gha-have-runtime || { echo "gha runtime unavailable" && exit 13 ; }
|
||||
set -Euo pipefail
|
||||
export INPUT_key="$1" INPUT_path="$2"
|
||||
/c/Program\ Files/nodejs/node /d/a/_actions/actions/cache/v4/dist/restore-only/index.js \
|
||||
local node="${node:-/c/Program Files/nodejs/node}"
|
||||
local _actions="${_actions:-/d/a/_actions}"
|
||||
|
||||
export INPUT_KEY="$1" INPUT_PATH="$2"
|
||||
$node $_actions/actions/cache/v4/dist/restore-only/index.js \
|
||||
| grep -i 'cache restored' >&2 && return 0
|
||||
echo "(cache not restored: ${INPUT_key})" >&2
|
||||
echo "(cache not restored: ${INPUT_KEY})" >&2
|
||||
return 1
|
||||
)}
|
||||
|
||||
@@ -230,7 +234,9 @@ function gha-cache-save-fast() {(
|
||||
test -v GITHUB_ACTIONS || return 0
|
||||
gha-have-runtime || { echo "gha runtime unavailable" && exit 13 ; }
|
||||
set -Euo pipefail
|
||||
export INPUT_key="$1" INPUT_path="$2"
|
||||
/c/Program\ Files/nodejs/node /d/a/_actions/actions/cache/v4/dist/save-only/index.js || return $?
|
||||
echo "cache saved: ${INPUT_key}" >&2
|
||||
local node="${node:-/c/Program Files/nodejs/node}"
|
||||
local _actions="${_actions:-/d/a/_actions}"
|
||||
export INPUT_KEY="$1" INPUT_PATH="$2"
|
||||
$node $_actions/actions/cache/v4/dist/save-only/index.js || return $?
|
||||
echo "cache saved: ${INPUT_KEY}" >&2
|
||||
)}
|
||||
|
||||
@@ -72,16 +72,19 @@ function gha-upload-artifact() {(
|
||||
function gha-upload-artifact-fast() {(
|
||||
test -v GITHUB_ACTIONS || return 0
|
||||
set -Euo pipefail
|
||||
export INPUT_name="`gha-esc "$1"`"
|
||||
export INPUT_path="`gha-esc "$2"`"
|
||||
local node="${node:-/c/Program Files/nodejs/node}"
|
||||
local _actions="${_actions:-/d/a/_actions}"
|
||||
|
||||
export INPUT_NAME="`gha-esc "$1"`"
|
||||
export INPUT_PATH="`gha-esc "$2"`"
|
||||
env \
|
||||
INPUT_retention-days=${3:-1} \
|
||||
INPUT_compression-level=${4:-0} \
|
||||
INPUT_overwrite=${5:-false} \
|
||||
INPUT_include-hidden-files=true \
|
||||
INPUT_if-no-files-found=error \
|
||||
/c/Program\ Files/nodejs/node /d/a/_actions/actions/upload-artifact/v4/dist/upload/index.js || return $?
|
||||
echo "uploaded: ${INPUT_path}" >&2
|
||||
INPUT_RETENTION-DAYS=${3:-1} \
|
||||
INPUT_COMPRESSION-LEVEL=${4:-0} \
|
||||
INPUT_OVERWRITE=${5:-false} \
|
||||
INPUT_INCLUDE-HIDDEN-FILES=true \
|
||||
INPUT_IF-NO-FILES-FOUND=error \
|
||||
$node $_actions/actions/upload-artifact/v4/dist/upload/index.js || return $?
|
||||
echo "uploaded: ${INPUT_PATH}" >&2
|
||||
)}
|
||||
|
||||
##############################################################################
|
||||
|
||||
Reference in New Issue
Block a user