fix: extract actual token from secret-mgr output

secret-mgr get-secret outputs 'Access token was successfully created: <token>'
so we need to extract just the token using awk '{print $NF}'
This commit is contained in:
lyn
2026-04-01 14:56:43 +00:00
parent fa77b054a5
commit 22b1154429
2 changed files with 6 additions and 3 deletions

View File

@@ -40,8 +40,8 @@ if ! secret-mgr list 2>/dev/null | grep -q "git-access-token"; then
"$SCRIPT_DIR/generate-access-token"
fi
# Get the access token
GIT_TOKEN="$(secret-mgr get-secret --key git-access-token)"
# Get the access token (extract actual token from "Access token was successfully created: <token>")
GIT_TOKEN="$(secret-mgr get-secret --key git-access-token | awk '{print $NF}')"
if [[ -z "$GIT_TOKEN" ]]; then
echo "Error: Failed to get git-access-token"