0
votes

My CI/CD pipeline that is using github workflows is failing giving the following error:

Error: Unable to process command '##[add-path]/opt/hostedtoolcache/aws/0.0.0/x64' successfully. Error: The add-path command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the ACTIONS_ALLOW_UNSECURE_COMMANDS environment variable to true. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

This is my container.yml file

name: deploy-container

on:
  push:
    branches:
      - master
      - develop
    paths:
      - "packages/container/**"

defaults:
  run:
    working-directory: packages/container

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - run: npm install
      - run: npm run build

      - uses: chrislennon/[email protected]
      - run: aws s3 sync dist s3://${{ secrets.AWS_S3_BUCKET_NAME }}/container/latest
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

Any idea why this might be happening. Thanks in advance

1
Did you try using another action than chrislennon/action-aws-cli to setup aws cli, as this one has been archived by his author (and may be obsolete)? You can find all of them on the Github Marketplace. - GuiFalourd

1 Answers

0
votes

I know the Tutorial which this is from, use

  - name: ACTIONS_ALLOW_UNSECURE_COMMANDS
    run: echo 'ACTIONS_ALLOW_UNSECURE_COMMANDS=true' >> $GITHUB_ENV

before

  - uses: chrislennon/[email protected]

and it should work.