Skip to content

Commit 05fc791

Browse files
committed
logs in ecr 3
1 parent b498569 commit 05fc791

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.github/workflows/deploy-to-ecr.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,32 @@ jobs:
9393
echo "INFO: AWS Region configured in Terraform is: '${TF_OUTPUT_AWS_REGION}'"
9494
fi
9595
96+
- name: Debug AWS Environment Variables Set by configure-aws-credentials
97+
run: |
98+
echo "Value of AWS_REGION env var: '${AWS_REGION}'" # Será enmascarado
99+
echo "Value of AWS_DEFAULT_REGION env var: '${AWS_DEFAULT_REGION}'" # Será enmascarado
100+
echo "--- All AWS related env vars ---"
101+
printenv | grep AWS_
102+
echo "--------------------------------"
103+
echo "Attempting AWS CLI call with detected AWS_REGION..."
104+
if [ -n "$AWS_REGION" ]; then
105+
# Intenta una llamada simple que use la región. El output se enmascarará si es sensible.
106+
aws sts get-caller-identity --region "$AWS_REGION" --output text
107+
if [ $? -ne 0 ]; then
108+
echo "::error::AWS CLI call FAILED using AWS_REGION: $AWS_REGION (valor real enmascarado si es sensible)"
109+
else
110+
echo "::notice::AWS CLI call SUCCEEDED using AWS_REGION: $AWS_REGION (valor real enmascarado si es sensible)"
111+
fi
112+
else
113+
echo "::warning::AWS_REGION environment variable is not set or empty."
114+
fi
115+
96116
- name: Login to Amazon ECR
97117
id: login-ecr
98118
uses: docker/login-action@v3
99119
with:
100-
ecr: true
120+
registry: ${{ env.ECR_REPOSITORY_URL }}
121+
# ecr: true
101122

102123
- name: Build, tag, and push image to Amazon ECR
103124
id: build-image

0 commit comments

Comments
 (0)