r/GoogleAppsScript • u/Rude_Union_7313 • May 06 '26
Question Syncing Google Apps Script with GitHub repo (auto-deploy on push?)
Hey y'all,
Is there a clean way to keep a Google Apps Script project in sync with a GitHub repo, so that on every push/commit the latest code is automatically deployed to Apps Script?
Ideally looking for something CI/CD-like (e.g. via GitHub Actions or similar), rather than manually pulling/pushing with clasp.
Curious how people are handling version control + deployment flows here. Any best practices or setups would be super helpful.
Thanks!
9
Upvotes
View all comments
Show parent comment
-1
u/Still_Dingo6159 May 07 '26
This might work honey Bee:
The function executes a synchronized sequence of three HTTP requests to the Google Apps Script REST API and consolidates the responses. The first request uses the PUT method to overwrite the project's draft code with the provided source string. The second request uses the POST method to instantiate a new active deployment from that uploaded draft code. The third request uses the GET method to retrieve the recent execution history and status of the specified script ID. The responses from all three sequential network requests are parsed and returned simultaneously as a single JSON object for programmatic evaluation.