Skip to content

Commit 1c620d0

Browse files
committed
fix: consolidate jq calls, guard WOPI_TTL against null
1 parent e42e973 commit 1c620d0

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎ocis-test/action.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,13 @@ runs:
142142
"${OCIS_URL}/app/open?app_name=FakeOffice&file_id=${FILE_ID_ENC}")
143143
echo "open: ${OPEN:0:400}"
144144
145-
ACCESS_TOKEN=$(echo "$OPEN" | jq -r '.form_parameters.access_token')
146-
TTL=$(echo "$OPEN" | jq -r '.form_parameters.access_token_ttl')
147-
APP_URL=$(echo "$OPEN" | jq -r '.app_url // ""')
145+
read -r ACCESS_TOKEN TTL APP_URL < <(
146+
echo "$OPEN" | jq -r '[
147+
.form_parameters.access_token,
148+
(.form_parameters.access_token_ttl | if type == "number" then tostring else "0" end),
149+
(.app_url // "")
150+
] | @tsv'
151+
)
148152
149153
# Extract encoded file ID from app_url, fall back to re-encoding FILE_ID
150154
if echo "$APP_URL" | grep -q 'files%2F'; then

0 commit comments

Comments
 (0)