google-github-actions / upload-cloud-storage

A GitHub Action for uploading files to a Google Cloud Storage (GCS) bucket.
https://cloud.google.com/storage
Apache License 2.0
206 stars 49 forks source link

Clean up Readme re: file paths #286

Closed haggman closed 1 year ago

haggman commented 1 year ago

TL;DR

The file paths used in the example don't work for me as written.

Detailed design

Now, I'm integrating these steps into an existing Actions file, doing a bunch of other stuff, if that's any kind of issue. 

In the Readme file example now it shows:

      with:
        path: '/path/to/file'
        destination: 'bucket-name/file'

To get it to actually work, I did:

      with:
        path: 'path/to/file'
        destination: 'bucket-name/folder'

Ditching the initial / on the path, and removing "file" from the destination. With those changes it grabbed the file correctly from the git cloned files, and it the file ended up in the bucket-name/folder location.



### Additional information

_No response_
sethvargo commented 1 year ago

Hi @haggman - thank you for opening an issue. This is how Unix file paths work. Without the leading /, they are presumed to be relative to the working directory. With the leading /, they start from the root. If you want to include files relative to your working directory, do not use a leading slash. See https://www.geeksforgeeks.org/absolute-relative-pathnames-unix/ for more details.