Skip to content

working-directory not respected #355

@jameswinegar

Description

@jameswinegar
jobs:
  build:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./subapp
        
      - name: Download task definition
        run: |
          aws ecs describe-task-definition --task-definition subapp --query taskDefinition > taskdefinition.json
          
      - name: new image in ECS taskdefinition
        id: task-def
        uses: aws-actions/amazon-ecs-render-task-definition@v1
        with:
          task-definition: taskdefinition.json
          container-name: subapp-container
          image: ${{ steps.login-ecr.outputs.registry }}/subapp:${{ github.sha }}          

Fails with file not found error, because it was written at the working directory. Workaround was to provide the path by using pwd.

      - name: Print current directory
        id: pwd
        run: echo "::set-output name=path::$(pwd)"

      - name: new image in ECS taskdefinition
        id: task-def
        uses: aws-actions/amazon-ecs-render-task-definition@v1
        with:
          task-definition: ${{ steps.pwd.outputs.path }}/taskdefinition.json
          container-name: subapp-container
          image: ${{ steps.login-ecr.outputs.registry }}/subapp:${{ github.sha }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions