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

can't find directory after creating a file and a folder with Error: ENOTDIR: not a directory. #49

Open
chanjungkim opened this issue Jan 6, 2023 · 5 comments

Comments

@chanjungkim
Copy link

Here's my yml script.

name: AWS Upload Action

on:
    push:

jobs:
    deploy:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v3
              with:
                fetch-depth: 0

            - name: set up JDK 11
              uses: actions/setup-java@v3
              with:
                java-version: '11'
                distribution: 'zulu'
                cache: gradle

            - name: Setup Android SDK
              uses: android-actions/setup-android@v2

            - name: Create Tets file
              run: touch ./creaeTest.txt

            - name: Find test txt
              run: find . -type f -name "creaeTest.txt" -exec mv {} ./deploy \;

            - name: delay
              run: sleep 10s
              shell: bash

            - uses: actions/checkout@master

            - uses: shallwefootball/s3-upload-action@master
              with:
                  aws_key_id: ${{ secrets.AWS_KEY_ID }}
                  aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
                  aws_bucket: ${{ secrets.AWS_BUCKET }}
                  destination_dir: ''
                  source_dir: 'deploy'

            - name: Delete deploy folder
              run: rm -rf ./deploy

And I get this error:

Run shallwefootball/s3-upload-action@master
node:internal/fs/utils:344
    throw err;
    ^

Error: ENOTDIR: not a directory, scandir '/home/runner/work/iam_aos/iam_aos/deploy'
    at Object.readdirSync (node:fs:1390:3)
    at klawSync (/home/runner/work/_actions/shallwefootball/s3-upload-action/master/dist/index.js:22219:25)
    at /home/runner/work/_actions/shallwefootball/s3-upload-action/master/dist/index.js:28871:15
    at /home/runner/work/_actions/shallwefootball/s3-upload-action/master/dist/index.js:28916:3
    at Object.<anonymous> (/home/runner/work/_actions/shallwefootball/s3-upload-action/master/dist/index.js:28919:[12](https://github.com/monolabsteam/iam_aos/actions/runs/3853512807/jobs/6566561474#step:8:13))
    at Module._compile (node:internal/modules/cjs/loader:1101:[14](https://github.com/monolabsteam/iam_aos/actions/runs/3853512807/jobs/6566561474#step:8:15))
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1[15](https://github.com/monolabsteam/iam_aos/actions/runs/3853512807/jobs/6566561474#step:8:16)3:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  errno: -[20](https://github.com/monolabsteam/iam_aos/actions/runs/3853512807/jobs/6566561474#step:8:21),
  syscall: 'scandir',
  code: 'ENOTDIR',
  path: '/home/runner/work/iam_aos/iam_aos/deploy'
}

It creates file correctly, but s3-upload-action can't find 'deploy' folder.

How can I solve this?

@bekanur98
Copy link

bekanur98 commented Feb 1, 2023

Do we need to provide them with our region in s3?

@EmilSabri
Copy link

Did you ever get it working?

@langsmith
Copy link

Did anyone figure this out? Thoughts on this, @shallwefootball ?

@bekanur98
Copy link

Did anyone figure this out? Thoughts on this, @shallwefootball ?

Just use aws cli like:

aws s3 cp ./folder_to_upload s3://${{env.S3_BUCKET_NAME}} 

1 similar comment
@bekanur98
Copy link

Did anyone figure this out? Thoughts on this, @shallwefootball ?

Just use aws cli like:

aws s3 cp ./folder_to_upload s3://${{env.S3_BUCKET_NAME}} 

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

4 participants