shallwefootball / upload-s3-action

github action for upload to S3 ☁️
https://github.com/marketplace/actions/upload-s3
166 stars 158 forks source link

Add Region: Resolve missing Key fatal error #29

Closed AgentGoldPaw closed 2 years ago

AgentGoldPaw commented 3 years ago

https://github.com/shallwefootball/upload-s3-action/issues/27 https://github.com/shallwefootball/upload-s3-action/issues/26

balexander commented 3 years ago

Thanks for this fix. Any idea when this will get merged in?

AgentGoldPaw commented 3 years ago

No idea. But if you need something for s3. I can post the workaround I have been using. The aws-sdk is included in actions so you can just use the regular sdk.

balexander commented 3 years ago

@drpym Thanks, I'd appreciate if you could post the work around

AgentGoldPaw commented 3 years ago

@balexander here you are

  - name: upload
     run: AWS_ACCESS_KEY_ID=${{secrets.AWS_ACCESS_KEY}} AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_KEY}} aws s3 cp ./myfile.txt s3://${{bucketName}}/myFile.txt
     working-directory: /dir/where/file/is/
AgentGoldPaw commented 3 years ago

@balexander something to note: If you ubuntu-latest it will error out. set

  os: [ubuntu-18.04]

sorry for another message, just wanted to make sure you saw this. You can also just AWS_REGION=region-here before aws and it should work on latest.

woodyhayday commented 3 years ago

Just to add here, changing os to [ubuntu-18.04] and using the mod @golden-protocol mentions:

  - name: upload
     run: AWS_ACCESS_KEY_ID=${{secrets.AWS_ACCESS_KEY}} AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_KEY}} aws s3 cp ./myfile.txt s3://${{bucketName}}/myFile.txt
     working-directory: /dir/where/file/is/

... works for me.

Though I'm not certain this, (or #27), is a region bug, as I get it with one of two buckets in the same region. I wondered if it's because of the public/no public access?:

Screenshot 2021-11-01 at 15 01 57

... either way, thanks for the helpful workaround.