From 60af48d02beae6826d40418c67e05ac029462304 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 5 Apr 2023 23:18:02 +0200 Subject: [PATCH 1/2] install dependencies before anything else --- forgejo-test-helper.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/forgejo-test-helper.sh b/forgejo-test-helper.sh index ebc53c9..a0bdc29 100755 --- a/forgejo-test-helper.sh +++ b/forgejo-test-helper.sh @@ -49,10 +49,6 @@ function api() { shift token=$1 - if ! which jq curl > /dev/null ; then - apt-get -qq install -y jq curl - fi - curl --fail -X $method -sS -H "Content-Type: application/json" -H "Authorization: token $token" "$@" $url/api/v1/$path } @@ -159,4 +155,12 @@ function push_self_action() { ) } +function dependencies() { + if ! which jq curl > /dev/null ; then + apt-get -qq install -y jq curl + fi +} + +dependencies + "$@" From 6a27a460b50c0c53521b8cdbfe4d6755843399a9 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 5 Apr 2023 23:27:33 +0200 Subject: [PATCH 2/2] version 1.19 is >= 1.19.0-3 --- forgejo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forgejo.sh b/forgejo.sh index 173d553..71d7905 100755 --- a/forgejo.sh +++ b/forgejo.sh @@ -28,7 +28,7 @@ function run() { local image="$1" local version="$2" - if dpkg --compare-versions "$version" "lt" "1.19.0-3"; then + if test "$version" != "1.19" && dpkg --compare-versions "$version" "lt" "1.19.0-3"; then actions_unit="actions.actions" else actions_unit="repo.actions"