We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5404da8 commit 0888419Copy full SHA for 0888419
scripts/lib/common.sh
@@ -149,7 +149,12 @@ is_public_ecr_logged_in() {
149
# Base64 decode it
150
# Read the "expiration" value
151
local expiration_time
152
- expiration_time=$(jq -r --arg url $public_ecr_url '.auths[$url].auth' ~/.docker/config.json | base64 -d | cut -d":" -f2 | base64 -d | jq -r ".expiration")
+ auth_string=$(jq -r --arg url $public_ecr_url '.auths[$url].auth' ~/.docker/config.json)
153
+
154
+ [ -z "$auth_string" ] && return 1
155
+ [ "$auth_string" = "null" ] && return 1
156
157
+ expiration_time=$(echo $auth_string | base64 -d | cut -d":" -f2 | base64 -d | jq -r ".expiration")
158
159
# If any part of this doesn't exist, the user isn't logged in
160
[ -z "$expiration_time" ] && return 1
0 commit comments