Skip to content

Commit 6328c57

Browse files
committed
fix: repair discord test workflow syntax
1 parent 9247828 commit 6328c57

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

.github/workflows/discord-test.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
local path="$2"
2323
local method="${3:-GET}"
2424
local body="${4:-}"
25-
local out bodyf code
25+
local bodyf code
2626
bodyf=$(mktemp)
2727
if [ -n "$body" ]; then
2828
code=$(curl -sS --http1.1 -o "$bodyf" -w '%{http_code}' \
@@ -46,8 +46,14 @@ jobs:
4646
}
4747
4848
pick() {
49-
local body code auth label
50-
while IFS='|' read -r label auth; do
49+
local body code auth label entry
50+
local pairs=(
51+
"user|$DISCORD_TOKEN"
52+
"bot|Bot $DISCORD_TOKEN"
53+
"bearer|Bearer $DISCORD_TOKEN"
54+
)
55+
for entry in "${pairs[@]}"; do
56+
IFS='|' read -r label auth <<< "$entry"
5157
mapfile -t out < <(call "$auth" /users/@me)
5258
code="${out[0]}"
5359
body="$(printf '%s\n' "${out[@]:1}")"
@@ -57,11 +63,7 @@ jobs:
5763
printf '%s' "$auth"
5864
return 0
5965
fi
60-
done <<EOF
61-
user|$DISCORD_TOKEN
62-
bot|Bot $DISCORD_TOKEN
63-
bearer|Bearer $DISCORD_TOKEN
64-
EOF
66+
done
6567
return 1
6668
}
6769

0 commit comments

Comments
 (0)