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
Hey - I think I know how you can do what you would like.
To clarify: you are saying —- When you deploy GAS you want it to sync to GitHub. And, you are deploying via CLASP?
There’s actually a few ways you could do it. You can just externally run project.update via scripts API or update.content & then push automated deploy
Or: Another way - when you invoke scripts.run invoke as part of batchexecute a sequential / concurrent call to a second sheet / distinct object (picture; sheets, word, whatever works for you, project bound; if it was sheets then, if that sheet is isolated you could take a version snapshot & run to change the cell value to version snap shot and in line log your version change; and have the OnChange trigger which will be triggered by any change to that sheet such as this, run a second function to sync your project with your GitHub repo, via a sync, in that moment.
Let me know if you’d like me to provide the code for you & what your invocation sequence is.
Best -