File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -47,13 +47,26 @@ runs:
4747 ACCESS_TOKEN=$(curl -sLS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=$AUDIENCE" | jq -r ".value")
4848 echo "::add-mask::$ACCESS_TOKEN"
4949
50+ # Validate required parameters
51+ if [[ "$ACCESS_TOKEN" == "null" || -z "$ACCESS_TOKEN" ]]; then
52+ echo "::error::Failed to obtain GitHub Actions ID token"
53+ exit 1
54+ fi
55+
5056 # Get Identity ID
5157 identityId=$(aws cognito-identity get-id \
5258 --identity-pool-id "$POOL_ID" \
5359 --account-id "$AWS_ACCOUNT_ID" \
5460 --logins '{"'"$IDENTITY_PROVIDER_NAME"'":"'"$ACCESS_TOKEN"'"}' \
5561 --query 'IdentityId' --output text)
5662
63+ # Validate Identity ID was obtained
64+ if [[ "$identityId" == "null" || -z "$identityId" ]]; then
65+ echo "::error::Failed to obtain Identity ID from Cognito Identity Pool"
66+ echo "::error::Check identity pool configuration and IAM roles"
67+ exit 1
68+ fi
69+
5770 # Get and validate AWS credentials
5871 awsCredentials=$(aws cognito-identity get-credentials-for-identity \
5972 --identity-id "$identityId" \
You can’t perform that action at this time.
0 commit comments