in src/main/resources/buildServerResources/gh-webhook.js [129:157]
doHandleResult: function (json, result) {
this.doHideProgress();
var good = ["AlreadyExists", "Created"];
var info = json['info'];
var message = json['message'];
var repo = info['owner'] + '/' + info['name'];
var server = info['server'];
if (good.indexOf(result) > -1) {
// Good one
const data = json['data'];
if (data !== undefined) {
var repository = data['repository'];
WH.data[repository] = data;
}
WH.forcePopup[server] = false;
$j("#installWebhookSubmit").attr("value", WH.INSTALL_BUTTON_TITLE);
WH.showSuccessMessage(message);
return
}
if ("TokenScopeMismatch" == result) {
message = "Token scope does not allow to install webhook to the repository '" + repo + "'";
$j("#installWebhookSubmit").attr("value", WH.SIGN_IN_BUTTON_TITLE);
WH.forcePopup[server] = true;
WH.showError(message);
return
}
onActionSuccessBasic(json, result);
},