Skip to content

Commit

Permalink
Merge pull request #18 from ubiquity-os/development
Browse files Browse the repository at this point in the history
Merge development into main
  • Loading branch information
gentlementlegen authored Nov 7, 2024
2 parents a5d298f + eb7c9ec commit 258cc61
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Binary file modified bun.lockb
100644 → 100755
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@octokit/rest": "^21.0.2",
"@octokit/types": "^13.6.1",
"@octokit/webhooks": "^13.3.0",
"@sinclair/typebox": "^0.33.20",
"@sinclair/typebox": "^0.33.21",
"@ubiquity-os/ubiquity-os-logger": "^1.3.2",
"dotenv": "^16.4.5",
"hono": "^4.6.9"
Expand Down
9 changes: 8 additions & 1 deletion src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ export async function createActionsPlugin<TConfig = unknown, TEnv = unknown, TSu
return;
}

const inputs = Value.Decode(inputSchema, github.context.payload.inputs);
const inputPayload = github.context.payload.inputs;
const inputSchemaErrors = [...Value.Errors(inputSchema, inputPayload)];
if (inputSchemaErrors.length) {
console.dir(inputSchemaErrors, { depth: null });
core.setFailed(`Error: Invalid inputs payload: ${inputSchemaErrors.join(",")}`);
return;
}
const inputs = Value.Decode(inputSchema, inputPayload);
const signature = inputs.signature;
if (!(await verifySignature(pluginOptions.kernelPublicKey, inputs, signature))) {
core.setFailed(`Error: Invalid signature`);
Expand Down
4 changes: 2 additions & 2 deletions src/octokit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Octokit } from "@octokit/rest";
import { Octokit } from "@octokit/core";
import { RequestOptions } from "@octokit/types";
import { paginateRest } from "@octokit/plugin-paginate-rest";
import { restEndpointMethods } from "@octokit/plugin-rest-endpoint-methods";
Expand All @@ -24,5 +24,5 @@ const defaultOptions = {
};

export const customOctokit = Octokit.plugin(throttling, retry, paginateRest, restEndpointMethods, paginateGraphQL).defaults((instanceOptions: object) => {
return { ...defaultOptions, ...instanceOptions};
return { ...defaultOptions, ...instanceOptions };
});

0 comments on commit 258cc61

Please sign in to comment.