This action download file from Google Drive. It's simple and secure.
For instructions on how to set up service account required to download file, see How to create a project, service account and generate authentication key section
- name: Download file X from Google Drive to default (./) directory
uses: k0staa/executable@v1
with:
service-account-auth-json: ${{ secrets.SERVICE_ACCOUNT_AUTH_JSON }}
download-file-name: bmw.jpg- name: Download file X from Google Drive to ./out/ directory
uses: k0staa/executable@v1
with:
service-account-auth-json: ${{ secrets.SERVICE_ACCOUNT_AUTH_JSON }}
download-file-name: bmw.jpg
download-to: ./out/-
service-account-key-jsonRequired The credentials key of the service account that is allowed to download file from Google Drive account. -
download-file-nameRequired File name of the file that should be downloaded. -
download-tooptional Download destination path. Default is the current directory. -
export-media-typeoptional mime type which allows to export Google Workspace documents. Supported mime types can be found here. Examples:application/vnd.openxmlformats-officedocument.wordprocessingml.document(docx),application/pdf,text/plain,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet(xlsx),application/vnd.openxmlformats-officedocument.presentationml.presentation(pptx),image/jpeg.
- Create a project in the Google Cloud Platform Console . See instructions
- Enable Google Drive API in new project. See instructions
- Create a service account for new project. See instructions
- Create authentication keys for the service account and download it as
jsonfile. See instructions - Share the file that you want to download to the service account. See instructions
PRs are accepted. Contributions to the roadmap are also welcome!
If you are having trouble or feature request, post new issue.
- Support batch download
- Support file download using file_id
- Support file download from provided folder name
- If you share two files with the same name (different folders), the first one found will be downloaded.
Thanks for all your support! (emoji key):
Mitchell Douglass 💻 |
Check LICENSE.md file.