aws-actions/amazon-ecs-render-task-definition

Family name not parsing output parameter

Closed this issue · 1 comments

I am trying to dynamically assign a family name using the branch name. The following lines in my action file generates the branch param:

 - name: Extract branch name
      shell: bash
      run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
      id: extract_branch

Then i reference it in my task definition:

"family": "frontend-${{ steps.extract_branch.outputs.branch }}"

However, it seems that it does not parse this output, since i get the following error when trying to deploy:
##[error]Failed to register task definition in ECS: Family contains invalid characters.
##[error]Family contains invalid characters.

I was of the impression that I could reference these output parameters anywhere in the task definition, as it works fine in
the image definition:

"image": "frontend:${{ steps.extract_branch.outputs.branch }}"

Are there some limitations to some of these fields in the task definition ? If so, it would be very desirable to have this on all task definition fields.

I realized that the example field "image", in my task definition JSON file, is actually overwritten by the statement:

with:
  image: frontend:${{ steps.extract_branch.outputs.branch }}

when using the action aws-actions/amazon-ecs-render-task-definition@v1.
So you simply assign parameters dynamically using the with statement.