recipe-watch-drive-changes
Installation
Summary
Subscribe to Google Drive file and folder changes via Pub/Sub notifications.
- Requires the
gws-eventsskill andgwsbinary to execute - Creates event subscriptions on Drive resources with configurable notification endpoints and payload options
- Supports subscription lifecycle management: create, list, and renew subscriptions before expiry
- Delivers change events (file updates) to Google Cloud Pub/Sub topics for downstream processing
SKILL.md
Watch for Drive Changes
PREREQUISITE: Load the following skills to execute this recipe:
gws-events
Subscribe to change notifications on a Google Drive file or folder.
Steps
- Create subscription:
gws events subscriptions create --json '{"targetResource": "//drive.googleapis.com/drives/DRIVE_ID", "eventTypes": ["google.workspace.drive.file.v1.updated"], "notificationEndpoint": {"pubsubTopic": "projects/PROJECT/topics/TOPIC"}, "payloadOptions": {"includeResource": true}}' - List active subscriptions:
gws events subscriptions list - Renew before expiry:
gws events +renew --subscription SUBSCRIPTION_ID
Related skills
More from googleworkspace/cli
gws-gmail
Gmail: Send, read, and manage email.
26.1Kgws-docs
Read and write Google Docs.
26.0Kgws-drive
Google Drive: Manage files, folders, and shared drives.
26.0Kgws-sheets
Google Sheets: Read and write spreadsheets.
24.7Kgws-calendar
Google Calendar: Manage calendars and events.
24.6Kgws-docs-write
Google Docs: Append text to a document.
21.8K