diff --git a/.github/workflows/tool-create-release.yml b/.github/workflows/tool-create-release.yml index 69892d69..83daec62 100644 --- a/.github/workflows/tool-create-release.yml +++ b/.github/workflows/tool-create-release.yml @@ -18,17 +18,19 @@ jobs: create_release: name: Create Release runs-on: ubuntu-latest + env: + tag: ${{ inputs.tag }} steps: - name: Validate Tag Format run: | - if [[ ! "${{ github.event.inputs.tag }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + if [[ ! "$tag" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Error: Tag must be in the format X.Y.Z (e.g. 1.0.0)" exit 1 fi - name: Configure AWS Credentials id: credentials - uses: aws-actions/configure-aws-credentials@v8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0 + uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0 with: role-to-assume: ${{ secrets.IAM_ROLE }} aws-region: ${{ vars.AWS_REGION }} @@ -42,8 +44,8 @@ jobs: run: | git config --global user.name "github-actions" git config --global user.email "github@github.com" - git tag ${{ github.event.inputs.tag }} - git push origin ${{ github.event.inputs.tag }} + git tag $tag + git push origin $tag - name: Full Deployment uses: ./.github/workflows/full-deployment.yml @@ -55,7 +57,6 @@ jobs: - name: Re-tag ECR Images with Release Tag env: IMAGE_SHA: ${{ github.sha }} - IMAGE_TAG: ${{ inputs.tag }} run: | repo-list=['deductions/ehr-out-service', 'deductions/ehr-repo', @@ -69,8 +70,8 @@ jobs: for repo in "${repo-list[@]}"; do repo=${{ steps.credentials.outputs.aws-account-id }}.dkr.ecr.eu-west-2.amazonaws.com/$repo docker pull $repo:$IMAGE_SHA - docker tag $repo:$IMAGE_SHA $repo:$IMAGE_TAG - docker push $repo:$IMAGE_TAG + docker tag $repo:$IMAGE_SHA $repo:$tag + docker push $repo:$tag done