3030 db_snapshot_arn : ${{ inputs.db_snapshot_arn }}
3131 egress_cidr : ${{ inputs.egress_cidr }}
3232 take_db_snapshot : ${{ inputs.take_db_snapshot }}
33- git_ref : ${{ inputs.git_ref_to_deploy || github.sha }}
33+ git_ref_to_deploy : ${{ inputs.git_ref_to_deploy || github.sha }}
3434 aws_role : ${{ inputs.environment == 'production'
3535 && 'arn:aws:iam::820242920762:role/GithubDeployDataReplicationInfrastructure'
3636 || 'arn:aws:iam::393416225559:role/GithubDeployDataReplicationInfrastructure' }}
6363 - name : Checkout code
6464 uses : actions/checkout@v5
6565 with :
66- ref : ${{ env.git_ref }}
66+ ref : ${{ env.git_ref_to_deploy }}
6767 - name : Get git sha
6868 id : get-git-sha
6969 run : echo "git-sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
@@ -79,14 +79,14 @@ jobs:
7979 prepare-deployment :
8080 name : Prepare deployment
8181 runs-on : ubuntu-latest
82- needs : build-and-push-image
82+ needs : [ build-and-push-image, determine-git-sha]
8383 permissions :
8484 id-token : write
8585 steps :
8686 - name : Checkout code
8787 uses : actions/checkout@v5
8888 with :
89- ref : ${{ env.git_ref }}
89+ ref : ${{ env.git_ref_to_deploy }}
9090 - name : Configure AWS Credentials
9191 uses : aws-actions/configure-aws-credentials@v5
9292 with :
9797 run : |
9898 digest=$(aws ecr describe-images \
9999 --repository-name mavis/webapp \
100- --image-ids imageTag=$git_ref \
100+ --image-ids imageTag=${{ needs.determine-git-sha.outputs.git-sha }} \
101101 --query 'imageDetails[0].imageDigest' \
102102 --output text)
103103 echo "digest=$digest" >> $GITHUB_OUTPUT
0 commit comments