Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

working-directory not respected #355

Open
jameswinegar opened this issue Jan 7, 2025 · 0 comments
Open

working-directory not respected #355

jameswinegar opened this issue Jan 7, 2025 · 0 comments

Comments

@jameswinegar
Copy link

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 }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant