Skip to content

Commit

Permalink
move
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Dec 17, 2024
1 parent f4cca1d commit 127cb57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 3 additions & 7 deletions src/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { GitHubBot } from '../github.bot'
import BaseMetrics from './base.metrics'
import IssuesLabeledDuplicate from './issues.labeled.duplicate'
import IssuesLabeledInvalid from './issues.labeled.invalid'
import IssuesLabeledNewDefaultRepository from './issues.labeled.new_default_repository'
import IssuesOpenedGreeter from './issues.opened.greeter'
import PullRequestClosedDefault from './pull_request.closed.default'
import PullRequestLabeledNewDefaultRepository from './pull_request.labeled.new_default_repository'
import PullRequestOpenedDefault from './pull_request.opened.default'
import WorkflowRunCompeted from './workflow_run.completed'

Expand All @@ -13,14 +13,10 @@ type Plugin = (bot: GitHubBot, payload: any) => Promise<void>

export const plugins: Record<string, Plugin[]> = {
base: [BaseMetrics],
'issues.labeled': [
IssuesLabeledDuplicate,
IssuesLabeledInvalid,
IssuesLabeledNewDefaultRepository,
],
'issues.labeled': [IssuesLabeledDuplicate, IssuesLabeledInvalid],
'issues.opened': [IssuesOpenedGreeter],
'pull_request.closed': [PullRequestClosedDefault],
'pull_request.labeled': [IssuesLabeledNewDefaultRepository],
'pull_request.labeled': [PullRequestLabeledNewDefaultRepository],
'pull_request.opened': [PullRequestOpenedDefault],
'pull_request.synchronize': [PullRequestOpenedDefault],
'workflow_run.completed': [WorkflowRunCompeted],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { IssuePullPayload, PayloadIsPull } from '../types'

import { GitHubBot } from '../github.bot'
import { extractOwnerRepo } from '../utils/extractOwnerRepo'
import { senderIsBot } from '../utils/filter'
import { RepositoryName } from '../const'

const label = 'New default repository'
Expand All @@ -22,7 +21,6 @@ export default async (
payload: IssuePullPayload,
): Promise<void> => {
if (
senderIsBot(payload) ||
!PayloadIsPull(payload) ||
extractOwnerRepo(payload).repo !== RepositoryName.DEFAULT ||
payload.action !== 'labeled' ||
Expand Down

0 comments on commit 127cb57

Please sign in to comment.