forked from microsoft/codespace-features
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth-ado.sh
More file actions
29 lines (24 loc) · 871 Bytes
/
auth-ado.sh
File metadata and controls
29 lines (24 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
echo "::step::Waiting for AzDO Authentication Helper..."
# Wait up to 3 minutes for the ado-auth-helper to be installed
MAX_WAIT=180
ELAPSED=0
while [ $ELAPSED -lt $MAX_WAIT ]; do
if [ -f "${HOME}/ado-auth-helper" ]; then
echo "::step::Running ado-auth-helper get-access-token..."
ARTIFACTS_ACCESSTOKEN=$(${HOME}/ado-auth-helper get-access-token)
echo "::step::✓ Access token retrieved successfully"
return 0
fi
sleep 2
ELAPSED=$((ELAPSED + 2))
# Progress indicator every 20 seconds
if [ $((ELAPSED % 20)) -eq 0 ]; then
echo " Still waiting... (${ELAPSED}s elapsed)"
fi
done
# Timeout reached
echo "::error::AzDO Authentication Helper not found after ${MAX_WAIT} seconds"
echo "Expected location: ${HOME}/ado-auth-helper"
echo "Restore cannot proceed without authentication"
return 1