mirror of
https://github.com/outline/outline.git
synced 2026-12-02 09:42:07 +03:00
Listen to GitHub webhooks to update issueSources cache (#9414)
* Listen to GitHub webhooks to update issue-sources cache * Add `GitHubWebhookTask` * review
This commit is contained in:
1 parent
cd83f41294
commit
7d315288dd
13 files changed
+397
-8
No files matched your search
@@ -22,6 +22,8 @@ type PR =
|
||||
Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}"]["response"]["data"];
|
||||
type Issue =
|
||||
Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}"]["response"]["data"];
|
||||
type Installation =
|
||||
Endpoints["GET /app/installations/{installation_id}"]["response"]["data"];
|
||||
|
||||
const requestPlugin = (octokit: Octokit) => ({
|
||||
requestRepos: () =>
|
||||
@@ -86,6 +88,23 @@ const requestPlugin = (octokit: Octokit) => ({
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Fetches details of a specific GitHub app installation
|
||||
*
|
||||
* @param installationId Id of the installation to fetch
|
||||
* @returns Response containing installation details
|
||||
*/
|
||||
requestAppInstallation: async (
|
||||
installationId: number
|
||||
): Promise<OctokitResponse<Installation>> =>
|
||||
octokit.request("GET /app/installations/{installation_id}", {
|
||||
installation_id: installationId,
|
||||
headers: {
|
||||
Accept: "application/vnd.github+json",
|
||||
"X-GitHub-Api-Version": "2022-11-28",
|
||||
},
|
||||
}),
|
||||
|
||||
/**
|
||||
* Uninstalls the GitHub app from a given target
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user