Replies: 3 comments 3 replies
-
|
The ECR_BACKEND_URI environment variable is empty or not being passed correctly. When it's empty, the command docker tag fittrack-backend:latest $ECR_BACKEND_URI:latest becomes docker tag fittrack-backend:latest :latest, which is invalid. This happens because the backend_uri output from the first job isn't being retrieved properly or the Terraform output is failing. Fix Additional Issues to Address cd terraform/staging
ALB_DNS=$(terraform output -raw alb_dns_name)Line 159: Syntax error - missing closing quote: echo "::add-mask::$BUCKET_URL"Line 166: Wrong S3 URI format - should use s3:// not s3:/: aws s3 sync fitness/frontend/dist s3://$S3_FRONTEND_BUCKET_URL --delete
Line 128: Using actions/checkout@v6 instead of actions/setup-node@v4 for Node.js setup. |
Beta Was this translation helpful? Give feedback.
-
|
Your output mapping is correct. The You register A masked value is treated as a secret. Step outputs can still be used later inside the same job, which is why your verification step works, but GitHub redacts secret-looking job outputs and does not send them to downstream jobs. Near the end of the GitHub documents both parts of this behavior: Two fixes:
# job 1
outputs:
backend_repo: ${{ steps.ecr-uris.outputs.backend_repo }}
- id: ecr-uris
run: |
cd terraform/staging
BACKEND_REPO=$(terraform output -raw backend_repository_name)
echo "backend_repo=$BACKEND_REPO" >> "$GITHUB_OUTPUT"
# job 2
env:
ECR_BACKEND_URI: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-central-1.amazonaws.com/${{ needs.deploy.outputs.backend_repo }}So the key distinction is: |
Beta Was this translation helpful? Give feedback.
-
|
This is one of the most common GitHub Actions gotchas. The issue is almost always one of three things: Root Cause & Fix1. Missing
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Question
💬 Feature/Topic Area
Workflow Deployment
Discussion Details
Hi everyone,
I'm trying to pass an ECR repository URI from one GitHub Actions job to another using job outputs. In Job 1, terraform output -raw returns the correct value, it's successfully written to $GITHUB_OUTPUT, and steps.ecr-uris.outputs.backend_uri contains the expected URI. However, in Job 2, needs.deploy.outputs.backend_uri is always empty, causing my Docker tag command to fail with Error parsing reference: ":latest" is not a valid repository/tag. My job output is defined as:
Job 1
After job 1 successfuly ran
✅ Backend URI: ***.dkr.ecr.eu-central-1.amazonaws.com/staging-backend-repoStep output = '***.dkr.ecr.eu-central-1.amazonaws.com/staging-backend-repo'
Job 2
Error showing up at job 2
Beta Was this translation helpful? Give feedback.
All reactions