Merge pull request 'install dependencies before anything else' (#13) from earl-warren/setup-forgejo:wip-api into main

Reviewed-on: https://code.forgejo.org/actions/setup-forgejo/pulls/13
Reviewed-by: dachary <dachary@noreply.code.forgejo.org>
This commit is contained in:
earl-warren 2023-04-05 21:35:51 +00:00
commit 33c7a0c667
2 changed files with 9 additions and 5 deletions

View file

@ -49,10 +49,6 @@ function api() {
shift shift
token=$1 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 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
"$@" "$@"

View file

@ -28,7 +28,7 @@ function run() {
local image="$1" local image="$1"
local version="$2" 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" actions_unit="actions.actions"
else else
actions_unit="repo.actions" actions_unit="repo.actions"