Is there a supported way to update Script Extension code using an API? For example, have scripts stored in a GitHub repository, built using GitHub Actions, and then deployed to Airtable. Currently, my team have just been manually copying and pasting code they build locally onto Airtable, which leaves a pretty large hole for human error (even ignoring the tedium of such a task).
I have a horrible workaround that I may use if necessary:
/**
* Fetches and executes the JavaScript file at the provided `path`.
* This can be thought of like:
*
* ```js
* await import(path);
* ```
*
* Except this bypasses CORS and directly injects the remote code.
* Wildly unsafe.
*
* @param {string} path
*/
async function fetchAndRun(path) {
const response = await fetch(path);
const text = await response.text();
eval(text);
}
const myExternalCode = "https://gist.githubusercontent.com/ZacHarroldPartum/fa0f6b6e707c8de3edf725ea0747bba3/raw/2f2fd47a248e8c3954727755ad35ac00193ef113/hello_world.js";
await fetchAndRun(myExternalCode);
The above is quite inefficient and wildly unsafe, but would allow for automated deployment of updates to our scripts by simply updating the file that URL points to. Could potentially store code with an Airtable base instead of a remote URL, but the process is largely the same.