Skip to content

Commit 3298bff

Browse files
committed
fix setGithubWebhook not returning the webhook URL
1 parent dedc391 commit 3298bff

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

.changeset/bright-peaches-hear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@squarecloud/api": patch
3+
---
4+
5+
Fix `Application#deploys#setGithubWebhook` not returning the webhook URL

.changeset/wet-rats-try.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@squarecloud/api": patch
3+
---
4+
5+
Rename `Application#deploys#setGithubWebhook` to `getGithubWebhook`

src/managers/application/deploys.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class ApplicationDeploysManager {
99
*
1010
* @param accessToken - The access token for your GitHub repository. You can find this in your [GitHub Tokens Classic](https://github.com/settings/tokens/new)
1111
*/
12-
async setGithubWebhook(accessToken: string) {
12+
async getGithubWebhook(accessToken: string) {
1313
assertString(accessToken);
1414

1515
const data = await this.application.client.api.application(
@@ -22,7 +22,7 @@ export class ApplicationDeploysManager {
2222
},
2323
);
2424

25-
return data.status === "success";
25+
return data.response.webhook;
2626
}
2727

2828
/**

src/types/api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
APIReadFile,
1111
APIWebsiteApplication,
1212
RESTPostAPIApplicationUploadResult,
13+
RESTPostAPIGithubWebhookResult,
1314
} from "@squarecloud/api-types/v2";
1415

1516
export interface APIApplicationEndpoints {
@@ -23,4 +24,5 @@ export interface APIApplicationEndpoints {
2324
"all/status": APIApplicationStatusAll[];
2425
"network/analytics": APINetworkAnalytics;
2526
"deploys/list": APIDeploy[];
27+
"deploy/git-webhook": RESTPostAPIGithubWebhookResult;
2628
}

0 commit comments

Comments
 (0)