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 55f8999 commit c66a973Copy full SHA for c66a973
1 file changed
aws/setup/docker/build_and_push_aws.sh
@@ -55,6 +55,16 @@ if [ -z "${GITHUB_TOKEN:-}" ]; then
55
exit 1
56
fi
57
58
+# Verify AWS account identity
59
+echo -e "${YELLOW}Checking AWS account identity...${NC}"
60
+CURRENT_ACCOUNT=$(aws sts get-caller-identity --query Account --output text 2>/dev/null || echo "unknown")
61
+EXPECTED_ACCOUNT=$(echo $ECR_REGISTRY | cut -d'.' -f1)
62
+if [ "$CURRENT_ACCOUNT" != "$EXPECTED_ACCOUNT" ]; then
63
+ echo -e "${RED}ERROR: Your current AWS account ($CURRENT_ACCOUNT) does NOT match the target ECR account ($EXPECTED_ACCOUNT)!${NC}"
64
+ exit 1
65
+fi
66
+echo -e "${GREEN}✓ AWS account matches target ECR account${NC}"
67
+
68
# Build the Docker image
69
echo -e "${YELLOW}Building Docker image...${NC}"
70
FULL_IMAGE_NAME="$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
0 commit comments