youyo / aws-cdk-github-actions

MIT License
205 stars 101 forks source link

Require approval: never is broken #20

Open stilren opened 4 years ago

stilren commented 4 years ago

Hello and thanks for this action.

I am deploying a project with two stacks (probably not relevant) and I am getting the following

This deployment will make potentially sensitive changes according to your current security approval level (--require-approval broadening).
Please confirm you intend to make the following modifications:

and

 "--require-approval" is enabled and stack includes security-sensitive updates, but terminal (TTY) is not attached so we are unable to get a confirmation from the user

Here is the action:

    - name: Deploy backend
      uses: youyo/aws-cdk-github-actions@v1
      with:
        working_dir: "./backend" 
        cdk_subcommand: 'deploy'
        cdk_stack: '*'
        actions_comment: false
        args: '--require-approval never --outputs-file ../swedishclient/src/devoutputs.json'
      env:
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET }}
        AWS_DEFAULT_REGION: 'eu-west-1'
stilren commented 4 years ago

I think we need to use a interactive session by passing the "-it" flag in the docker run command but I am not in a position to test this atm.

RicoToothless commented 4 years ago

I face the same issue, too.

bastiankoetsier commented 4 years ago

Same for us.

tmaximini commented 4 years ago

Anyone found a workaround? Like this it's not possible to deploy from GH actions...

cmsd2 commented 4 years ago

workaround: change this:

cdk_subcommand: "deploy"
args: "--require-approval never"

to this: cdk_subcommand: "deploy --require-approval never"

this works because the subcommand parameter is not quoted in the entrypoint script so the shell will split it on spaces.

i think it indicates that the problem lies with passing in the "*" parameters to the script rather than with require-approval itself.

g-farrow commented 4 years ago

This can also be solved by setting the flag in your cdk.json file, for example: { "app": "python3 app.py", "requireApproval": "never", "context": {...} }

davitcito commented 2 years ago

workaround: change this:

cdk_subcommand: "deploy"
args: "--require-approval never"

to this: cdk_subcommand: "deploy --require-approval never"

this works because the subcommand parameter is not quoted in the entrypoint script so the shell will split it on spaces.

i think it indicates that the problem lies with passing in the "*" parameters to the script rather than with require-approval itself.

This works for me. Thanks!

diogobaltazar commented 1 year ago

Having the same issue with:

yes | cdk deploy
   --app "npx ts-node bin/stack.ts"
   --required-approval never
   --profile profile
   --context account=account
   --context region=region