Skip to content

Instantly share code, notes, and snippets.

@timhettler
Last active October 7, 2020 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timhettler/b8c9a461a3e08ac8bb9b21ba714796d6 to your computer and use it in GitHub Desktop.
Save timhettler/b8c9a461a3e08ac8bb9b21ba714796d6 to your computer and use it in GitHub Desktop.
Trigger a Netlify Webhook
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Site')
.addItem('Deploy to Netlify', 'callNetlifyToDeploy')
.addToUi()
}
function callNetlifyToDeploy() {
var data = {}
var options = {
method: 'post',
contentType: 'application/json',
payload: JSON.stringify(data),
}
UrlFetchApp.fetch(
'https://api.netlify.com/build_hooks/XXXXXXX',
options
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment