Vimal Kurien Sam
Vimal Kurien Sam

Reputation: 266

Github Workflows CI/CD failing

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

Upvotes: 3

Views: 1078

Answers (2)

shubham kumar
shubham kumar

Reputation: 17

jobs: build: runs-on: ubuntu-latest

steps:
  - uses: actions/checkout@v2
  - run: npm install
  - run: npm run build
  
  - uses: aws-actions/configure-aws-credentials@v1
    with:
      aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
      aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      aws-region: us-east-1
  - run: aws s3 sync dist s3://${{ secrets.AWS_S3_BUCKET_NAME }}/container/latest

Upvotes: 1

Lord Gulasch
Lord Gulasch

Reputation: 116

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.

Upvotes: 7

Related Questions