Github action for download google drive files and folders
MIT License
Github action for downloading google-drive files or folder using Drives: list API
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: raeperd/raeperd/[email protected]
with:
clientId: ${{ secrets.CLIENT_ID }}
clientSecret: ${{ secrets.CLIENT_SECRET }}
redirectUri: ${{ secrets.REDIRECT_URI }}
credential_json: ${{ secrets.CREDENTIAL_JSON }}
q: "'1U-2NgagKTnqkIZrML52A2SsD9HDDeDN7' in parents"
path: "./"
clientId
(required)
clientSecret
(required)
redirectUri
(required)
credential_json
(required)
https://www.googleapis.com/auth/drive.readonly
q
(required)
path
(optional)
./
Before we start, we need Google Drive Application Project and credential.json
client_secret.json
file from the API Console.credential.json
credential.json
using Node.js quickstart | Google Drive API
credential.json
using ts-node - npm
client_secret.json
file into repository directory with name oauth.keys.json
ts-node write-credential.ts
❗❗ NEVER INCLUDE YOUR CLIENT SECRET (oauth.keys.json
and credential.json
) IN VERSION CONTROL ❗❗
To run this action, we need 4 repository secret parameter
client_secret.json
(or oauth.keys.json
)credential.json
created by you
JSON.parse()
function.Use debug.ts file in this repo
CLIENT_ID
, CLIENT_SECRET
, REDIRECT_URI
, CREDENTIAL_JSON
query
inside main()
functionts-node ./debug.ts
and checkout results❗❗ **NEVER INCLUDE YOUR CHANGES OF debug.ts
IN VERSION CONTROL ❗❗