Hello all,
I’m trying to create a build hook through the API, using netlify/js-client
,
from a Node.js console script.
I’m calling netlify.createSiteBuildHook()
and its successfully creating the
hook.
try {
result = await netlify.createSiteBuildHook({
site_id: 'SITE_ID',
title: 'Build from function',
branch: 'master'
});
console.log(result);
} catch (e) {
console.log(e);
}
However, title
and branch
parameters seem to be ignored, as the hook in the
UI is created with empty name and branch.
Also, in the response, both fields are returned null
.
This is the intercepted payload of the request and response:
"scope": "https://api.netlify.com:443",
"method": "POST",
"path": "/api/v1/sites/SITE_ID/build_hooks",
"body": "",
"status": 201,
"response": {
"title": null,
"branch": null,
"url": "https://api.netlify.com/build_hooks/SITE_ID",
"created_at": "2019-09-25T19:12:01.829Z",
"id": "5d8bbc018b502a88aa760ed0",
"site_id": "SITE_ID",
"msg": "POST https://api.netlify.com/build_hooks/5d8bbc018b502a88aa760ed0 to trigger a build"
},
Is this a possible bug or am I calling the method the wrong way?
Thanks!