Last active
October 7, 2020 03:58
-
-
Save timhettler/b8c9a461a3e08ac8bb9b21ba714796d6 to your computer and use it in GitHub Desktop.
Trigger a Netlify Webhook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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