mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-11-23 23:40:59 -05:00
show all statuses on failure
This commit is contained in:
parent
fdd4ccf4c3
commit
64e3b2e23e
1 changed files with 10 additions and 2 deletions
|
@ -44,12 +44,20 @@ function build_runner() {
|
||||||
forgejo-runner --version
|
forgejo-runner --version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_status() {
|
||||||
|
local url="$1"
|
||||||
|
local repo="$2"
|
||||||
|
local sha="$3"
|
||||||
|
|
||||||
|
forgejo-curl.sh api_json $url/api/v1/repos/$repo/commits/$sha/status
|
||||||
|
}
|
||||||
|
|
||||||
function check_status() {
|
function check_status() {
|
||||||
local url="$1"
|
local url="$1"
|
||||||
local repo="$2"
|
local repo="$2"
|
||||||
local sha="$3"
|
local sha="$3"
|
||||||
|
|
||||||
local state=$(forgejo-curl.sh api_json $url/api/v1/repos/$repo/commits/$sha/status | jq --raw-output .state)
|
local state=$(get_status $url $repo $sha | jq --raw-output .state)
|
||||||
echo $state
|
echo $state
|
||||||
test "$state" != "" -a "$state" != "pending" -a "$state" != "running" -a "$state" != "null"
|
test "$state" != "" -a "$state" != "pending" -a "$state" != "running" -a "$state" != "null"
|
||||||
}
|
}
|
||||||
|
@ -67,8 +75,8 @@ function wait_success() {
|
||||||
sleep $LOOP_DELAY
|
sleep $LOOP_DELAY
|
||||||
done
|
done
|
||||||
if ! test "$(check_status "$url" "$repo" "$sha")" = "success" ; then
|
if ! test "$(check_status "$url" "$repo" "$sha")" = "success" ; then
|
||||||
|
get_status $url $repo $sha | jq .statuses
|
||||||
test "$FORGEJO_RUNNER_LOGS" && cat $FORGEJO_RUNNER_LOGS
|
test "$FORGEJO_RUNNER_LOGS" && cat $FORGEJO_RUNNER_LOGS
|
||||||
forgejo-curl.sh api_json $url/api/v1/repos/$repo/commits/$sha/status | jq .
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue