Search code examples
node.jsgoogle-apps-scriptgoogle-cloud-platformgoogle-apps-script-api

How to programmatically deploy a Google Apps Script as a standard GCP project


Using the Node.js client for Google Apps Script API, I am able to deploy a script. However, according to Google's documentation and my own trial-and-error with the run method, in order to trigger that script to run from the Node.js client, the script must be a standard Google Cloud Platform (GCP) script, not a default GCP script (see their documentation on the difference). By default, all Apps Scripts are [unsurprisingly] default GCP projects.

In order to change a default Apps Script to become a standard Apps Script, it seems that I would have to manually visit in a browser the settings for that default script project in the Apps Script dashboard and manually place it into a standard GCP project.

However, my aim is to automate the process of deploying and executing these scripts via the API. So this manual settings change in a web browser defeats the entire purpose. I cannot find any documentation on how to do this programmatically. Any leads much appreciated.


Solution

  • Sadly, what you want cannot be achieved as in order to change the attached GCP project of an Apps Script project should be done manually.

    You can check a list of methods supported by the Apps Script API here.

    Reference