Skip to content

Commit

Permalink
Check-http-status (#7)
Browse files Browse the repository at this point in the history
* Add dependabot

* Show failures
  • Loading branch information
marcduiker authored Jul 7, 2022
1 parent b73c1e0 commit 1debc39
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
8 changes: 8 additions & 0 deletions ControlApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ class AblyControlApi {
};

const response = await this.post(`${accountApi}/${this.accountId}/apps`, request);
if (!response.ok) {
core.error(response.statusText);
throw new Error(response.text());
}
return response.json();
}

Expand Down Expand Up @@ -87,6 +91,10 @@ class AblyControlApi {
.filter((capability) => capability !== "");

const response = await this.post(`${appApi}/${appId}/keys`, { name: keyName, capability: { "*": capabilities } });
if (!response.ok) {
core.error(response.statusText);
throw new Error(response.text());
}
return response.json();
}

Expand Down
8 changes: 8 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ class AblyControlApi {
};

const response = await this.post(`${accountApi}/${this.accountId}/apps`, request);
if (!response.ok) {
core.error(response.statusText);
throw new Error(response.text());
}
return response.json();
}

Expand Down Expand Up @@ -93,6 +97,10 @@ class AblyControlApi {
.filter((capability) => capability !== "");

const response = await this.post(`${appApi}/${appId}/keys`, { name: keyName, capability: { "*": capabilities } });
if (!response.ok) {
core.error(response.statusText);
throw new Error(response.text());
}
return response.json();
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ably-control-api-action",
"version": "0.1.5",
"version": "0.1.6",
"description": "A GitHub Action to use the Ably Control API.",
"main": "index.js",
"scripts": {
Expand Down
22 changes: 22 additions & 0 deletions rest-api.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@accountsUrl=https://control.ably.net/v1/accounts

### Get Apps

GET {{accountsUrl}}/{{accountId}}/apps
Content-Type: application/json
Authorization: Bearer {{controlApiKey}}

### Create App

@appName=testing-the-control-api

POST {{accountsUrl}}/{{accountId}}/apps
Content-Type: application/json
Authorization: Bearer {{controlApiKey}}

{
"name": "{{appName}}",
"status": "enabled",
"tlsOnly": true,
"apnsUseSandboxEndpoint": false
}

0 comments on commit 1debc39

Please sign in to comment.