amplify-cli-action
amplify-cli-action copied to clipboard
./amplify/.config/local-env-info.json: No such file or directory
Hey, I'm getting this error with the configure command.
using amplify available at PATH
/usr/local/bin/amplify
amplify version Scanning for plugins...
Plugin scan successful
4.27.0
/entrypoint.sh: line 62: ./amplify/.config/local-env-info.json: No such file or directory
My job:
deploy:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [lint, test-unit, test-e2e, build]
steps:
- name: configure amplify
uses: ambientlight/[email protected]
with:
amplify_command: configure
amplify_env: prod
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: eu-west-1
Hm, this is strange, It fails at https://github.com/ambientlight/amplify-cli-action/blob/60165d38e083b3e52d7d026e038bdfb08a2fad14/entrypoint.sh#L62
Do you have amplify/.config/project-config.json commited in your repo?
Do you have amplify/.config/project-config.json commited in your repo?
No
The script for now doesn't check whether amplify/.config directory exists, I am also not quite sure whether it will run env pull without project-config.json, please check whether the step runs if you have project-config.json commited.
Is it the case that amplify/.config/project-config.json is now .gitignored in default amplify template? Or you have manually added it to .gitignore?
Is it the case that amplify/.config/project-config.json is now .gitignored in default amplify template? Or you have manually added it to .gitignore?
Not gitignored on my side.
Hi,
Same issue here, do we need to commit the amplify folder in order to get the configure working? or can we run amplify pull? I don't see in the action doc that amplify pull is supported
NVM after committing amplify/.config/project-config.json it's working, thank you.
I suspect it could be related to this https://github.com/aws-amplify/amplify-cli/issues/5931
hello. any fix?
Having the same issue, (running on 4.16.2). Tried the latest too, didn't work. /entrypoint.sh: line 62: ./amplify/.config/local-env-info.json: No such file or directory
Surprisingly, adding the
- uses: actions/checkout@v1
fixed the issue for me.
Below is my .yml script,
name: 'Amplify Configuration'
on:
push:
branches:
- develop
- staging
- master
jobs:
test:
name: amplify-cli-action
env:
awsRegion: us-east-1
amplifyVersion: 4.16.1
amplifyEnvironment: "${{ (github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/master') && 'prod' || 'dev' }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: configure amplify
uses: ambientlight/[email protected]
with:
amplify_cli_version: ${{ env.amplifyVersion }}
amplify_command: configure
amplify_env: ${{ env.amplifyEnvironment }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ env.awsRegion }}
- name: deploy/push amplify
uses: ambientlight/[email protected]
with:
amplify_cli_version: ${{ env.amplifyVersion }}
amplify_command: push
amplify_env: ${{ env.amplifyEnvironment }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ env.awsRegion }}
@thisismydesign @Fix-vinicius-oliveira @ambientlight
Hey, same issue here. Any fix?
The ./amplify/.config/local-env-info.json should be git ignored: https://docs.amplify.aws/cli/reference/files/#gitignore
So the action fails because the file is not available during runtime. A simple touch ./amplify/.config/local-env-info.json before echo should make it work I guess.
Faced the same issue, I committed ./amplify/.config/local-env-info.json to the repo and removed it from the .gitignore file as a temporary fix.
On top of that, I realised that I had to use 'project_dir' to point to my frontend subdirectory for steps using 'with'. Working-directory only works for steps with 'run'.