A GitHub Action (un-official) to Monitor a Google Drive Folder for changes/modifications and invoke a webhook with changed files and their properties.
-
Follow this guide on how to create a Service Account: https://www.labnol.org/google-api-service-account-220404
-
Share the Google Drive folder with the Service Account email address
GCLOUD_SERVICE_ACCOUNT
: Google Cloud Service Account credentials in JSON formatACCESS_TOKEN
: GitHub token, a Personal Access Token withpublic_repo
scope if needed. If the repo is private, a Personal Access Token withrepo
scope is needed
WEBHOOK_URL
: Optional webhook URL to receive files metadata whenever there are changesGOOGLE_FOLDER_ID
: Google Folder ID to monitor
name: Test Action
on:
push:
branches: [master]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
monitor-gdrive:
runs-on: ubuntu-latest
name: Test GitHub Action
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Monitor Google Drive Folder
id: run-chronos
env:
GOOGLE_FOLDER_ID: ${{ vars.GOOGLE_FOLDER_ID }}
WEBHOOK_URL: ${{ vars.WEBHOOK_URL }}
GCLOUD_SERVICE_ACCOUNT: ${{ secrets.GCLOUD_SERVICE_ACCOUNT }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
uses: tobetek/gdrive-chronos@master
Contributions are very much welcome. Open an Issue for bugs and feature requests. Send a PR to suggest changes!
"given enough eyeballs, all bugs are shallow"