shfmt -w globally

This commit is contained in:
Earl Warren 2024-08-07 08:31:33 +02:00
parent 4e207414d4
commit d5f66e4c0a
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
27 changed files with 378 additions and 375 deletions

View file

@ -10,7 +10,7 @@ api=$url/api/v1
repo=root/example-$example
function context_wait() {
if ! forgejo.sh retry test -f $context ; then
if ! forgejo.sh retry test -f $context; then
cat "$FORGEJO_RUNNER_LOGS"
false
fi
@ -19,7 +19,7 @@ function context_wait() {
function verify_required() {
local actual=$(forgejo-curl.sh api_json -w '%{http_code}' --data '{"ref":"main","inputs":{}}' $api/repos/$repo/actions/workflows/test.yml/dispatches)
local expected=400
if test "$actual" != $expected ; then
if test "$actual" != $expected; then
log_info "dispatch is expected to fail with status $expected because of string2 is a required value but got status $actual instead"
return 1
fi
@ -28,7 +28,7 @@ function verify_required() {
function verify_inputs() {
local inputs='{"string2":"value2"}'
forgejo-curl.sh api_json --data '{"ref":"main","inputs":'$inputs'}' $api/repos/$repo/actions/workflows/test.yml/dispatches
cat > $TMPDIR/expected <<'EOF'
cat >$TMPDIR/expected <<'EOF'
{
"boolean_default_false": "false",
"boolean_default_true": "true",
@ -46,7 +46,7 @@ function run_tests() {
npm --silent install json-diff
verify_inputs
context_wait
node_modules/.bin/json-diff <(jq .event.inputs < $context) $TMPDIR/expected
node_modules/.bin/json-diff <(jq .event.inputs <$context) $TMPDIR/expected
}
function main() {
@ -56,7 +56,7 @@ function main() {
run_tests
test "workflow_dispatch" = "$(jq -r .event_name < $context)"
test "workflow_dispatch" = "$(jq -r .event_name <$context)"
}
main