diff --git a/.husky/pre-commit b/.husky/pre-commit index 9aae9ec14..3bc4b0f16 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env sh . "$(dirname "$0")/_/husky.sh" # Run lint-staged first diff --git a/src/handlers/comment/handlers/assign/assign.ts b/src/handlers/comment/handlers/assign/assign.ts index 18a9851c9..a6d32a425 100644 --- a/src/handlers/comment/handlers/assign/assign.ts +++ b/src/handlers/comment/handlers/assign/assign.ts @@ -94,11 +94,12 @@ export async function assign(context: Context, body: string) { // double check whether the assign message has been already posted or not logger.info("Creating an issue comment", { comment }); - const { - multiplierAmount: multiplierAmount, - multiplierReason: multiplierReason, - totalPriceOfTask: totalPriceOfTask, - } = await getMultiplierInfoToDisplay(context, payload.sender.id, payload.repository.id, issue); + const { multiplierAmount, multiplierReason, totalPriceOfTask } = await getMultiplierInfoToDisplay( + context, + payload.sender.id, + payload.repository.id, + issue + ); return [ assignTableComment({ multiplierAmount, diff --git a/src/types/payload.ts b/src/types/payload.ts index 99d33bf23..7e55803d6 100644 --- a/src/types/payload.ts +++ b/src/types/payload.ts @@ -35,7 +35,7 @@ export enum GitHubEvent { export enum UserType { User = "User", Bot = "Bot", - // Organization = "Organization", + Organization = "Organization", } export enum IssueType { @@ -140,82 +140,82 @@ const issueSchema = Type.Object({ export type Issue = Static; const repositorySchema = Type.Object({ - id: Type.Number(), - node_id: Type.String(), - name: Type.String(), - full_name: Type.String(), - private: Type.Boolean(), - owner: userSchema, - html_url: Type.String(), + allow_forking: Type.Boolean(), + archive_url: Type.String(), + archived: Type.Boolean(), + assignees_url: Type.String(), + blobs_url: Type.String(), + branches_url: Type.String(), + clone_url: Type.String(), + collaborators_url: Type.String(), + comments_url: Type.String(), + commits_url: Type.String(), + compare_url: Type.String(), + contents_url: Type.String(), + contributors_url: Type.String(), + created_at: Type.String({ format: "date-time" }), + default_branch: Type.String(), + deployments_url: Type.String(), description: Type.Union([Type.String(), Type.Null()]), + disabled: Type.Boolean(), + downloads_url: Type.String(), + events_url: Type.String(), fork: Type.Boolean(), - url: Type.String(), + forks_count: Type.Number(), forks_url: Type.String(), - keys_url: Type.String(), - collaborators_url: Type.String(), - teams_url: Type.String(), + forks: Type.Number(), + full_name: Type.String(), + git_commits_url: Type.String(), + git_refs_url: Type.String(), + git_tags_url: Type.String(), + git_url: Type.String(), + has_downloads: Type.Boolean(), + has_issues: Type.Boolean(), + has_pages: Type.Boolean(), + has_projects: Type.Boolean(), + has_wiki: Type.Boolean(), hooks_url: Type.String(), + html_url: Type.String(), + id: Type.Number(), + is_template: Type.Boolean(), + issue_comment_url: Type.String(), issue_events_url: Type.String(), - events_url: Type.String(), - assignees_url: Type.String(), - branches_url: Type.String(), - tags_url: Type.String(), - blobs_url: Type.String(), - git_tags_url: Type.String(), - git_refs_url: Type.String(), - trees_url: Type.String(), - statuses_url: Type.String(), + issues_url: Type.String(), + keys_url: Type.String(), + labels_url: Type.String(), + language: Type.Any(), languages_url: Type.String(), - stargazers_url: Type.String(), - contributors_url: Type.String(), - subscribers_url: Type.String(), - subscription_url: Type.String(), - commits_url: Type.String(), - git_commits_url: Type.String(), - comments_url: Type.String(), - issue_comment_url: Type.String(), - contents_url: Type.String(), - compare_url: Type.String(), + license: Type.Any(), merges_url: Type.String(), - archive_url: Type.String(), - downloads_url: Type.String(), - issues_url: Type.String(), - pulls_url: Type.String(), milestones_url: Type.String(), + name: Type.String(), + node_id: Type.String(), notifications_url: Type.String(), - labels_url: Type.String(), - releases_url: Type.String(), - deployments_url: Type.String(), - created_at: Type.String({ format: "date-time" }), - updated_at: Type.String({ format: "date-time" }), + open_issues_count: Type.Number(), + open_issues: Type.Number(), + owner: userSchema, + private: Type.Boolean(), + pulls_url: Type.String(), pushed_at: Type.String({ format: "date-time" }), - git_url: Type.String(), - ssh_url: Type.String(), - clone_url: Type.String(), - svn_url: Type.String(), + releases_url: Type.String(), size: Type.Number(), + ssh_url: Type.String(), stargazers_count: Type.Number(), - watchers_count: Type.Number(), - language: Type.Any(), - has_issues: Type.Boolean(), - has_projects: Type.Boolean(), - has_downloads: Type.Boolean(), - has_wiki: Type.Boolean(), - has_pages: Type.Boolean(), - forks_count: Type.Number(), - archived: Type.Boolean(), - disabled: Type.Boolean(), - open_issues_count: Type.Number(), - license: Type.Any(), - allow_forking: Type.Boolean(), - is_template: Type.Boolean(), - web_commit_signoff_required: Type.Boolean(), + stargazers_url: Type.String(), + statuses_url: Type.String(), + subscribers_url: Type.String(), + subscription_url: Type.String(), + svn_url: Type.String(), + tags_url: Type.String(), + teams_url: Type.String(), topics: Type.Array(Type.Any()), + trees_url: Type.String(), + updated_at: Type.String({ format: "date-time" }), + url: Type.String(), visibility: Type.String(), - forks: Type.Number(), - open_issues: Type.Number(), + watchers_count: Type.Number(), watchers: Type.Number(), - default_branch: Type.String(), + web_commit_signoff_required: Type.Boolean(), }); export type Repository = Static;