Skip to content

Commit

Permalink
chore: remove GitHub Actions payload parsing and validation
Browse files Browse the repository at this point in the history
Deleted payload parsing and validation logic along with associated dependencies.
  • Loading branch information
gentlementlegen committed Oct 21, 2024
1 parent dda8ac3 commit df06946
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 87 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
"open-source"
],
"dependencies": {
"@actions/core": "1.10.1",
"@actions/github": "6.0.0",
"@octokit/graphql-schema": "^15.25.0",
"@octokit/rest": "^21.0.2",
"@octokit/webhooks": "^13.3.0",
Expand Down
50 changes: 0 additions & 50 deletions src/helpers/validator.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/parser/payload.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/types/plugin-input.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
import { EmitterWebhookEvent as WebhookEvent, EmitterWebhookEventName as WebhookEventName } from "@octokit/webhooks";
import { StaticDecode, StringOptions, Type as T, TypeBoxError } from "@sinclair/typebox";
import { Context } from "@ubiquity-os/ubiquity-os-kernel";
import ms from "ms";
import { StandardValidator } from "typebox-validators";

export type SupportedEvents = "pull_request_review_comment.created" | "issue_comment.created" | "push";

export interface PluginInputs<T extends WebhookEventName = SupportedEvents> {
stateId: string;
eventName: T;
eventPayload: WebhookEvent<T>["payload"];
settings: PluginSettings;
authToken: string;
ref: string;
}

export type ContextPlugin = Context<PluginSettings, Env, SupportedEvents>;

function thresholdType(options?: StringOptions) {
Expand Down Expand Up @@ -125,12 +114,8 @@ export const pluginSettingsSchema = T.Object(
{ default: {} }
);

export const pluginSettingsValidator = new StandardValidator(pluginSettingsSchema);

export type PluginSettings = StaticDecode<typeof pluginSettingsSchema>;

export const envSchema = T.Object({});

export const envValidator = new StandardValidator(envSchema);

export type Env = StaticDecode<typeof envSchema>;

0 comments on commit df06946

Please sign in to comment.