feat(GithubApp): update default events to include 'pull_request' and streamline event handling
This commit is contained in:
parent
e8ff21b3ca
commit
abf922b392
1 changed files with 4 additions and 1 deletions
|
|
@ -277,12 +277,15 @@ function createGithubApp(webhook_endpoint, preview_deployment_permissions, admin
|
|||
emails: 'read',
|
||||
administration: 'read'
|
||||
};
|
||||
const default_events = ['push'];
|
||||
if (preview_deployment_permissions) {
|
||||
default_permissions.pull_requests = 'write';
|
||||
default_events.push('pull_request');
|
||||
}
|
||||
if (administration) {
|
||||
default_permissions.administration = 'write';
|
||||
}
|
||||
|
||||
const data = {
|
||||
name,
|
||||
url: baseUrl,
|
||||
|
|
@ -297,7 +300,7 @@ function createGithubApp(webhook_endpoint, preview_deployment_permissions, admin
|
|||
setup_url: `${webhookBaseUrl}/source/github/install?source=${uuid}`,
|
||||
setup_on_update: true,
|
||||
default_permissions,
|
||||
default_events: ['pull_request', 'push']
|
||||
default_events
|
||||
};
|
||||
const form = document.createElement('form');
|
||||
form.setAttribute('method', 'post');
|
||||
|
|
|
|||
Loading…
Reference in a new issue