Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Dec 17, 2024
1 parent 849f45c commit 1485d09
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/plugins/issues.labeled.new_default_repository.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { IssuePullPayload, PayloadIsIssue } from '../types'
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'
const postedComment = `
Expand All @@ -22,8 +23,8 @@ export default async (
): Promise<void> => {
if (
senderIsBot(payload) ||
!PayloadIsIssue(payload) ||
payload.repository.name !== 'default' ||
!PayloadIsPull(payload) ||
extractOwnerRepo(payload).repo !== RepositoryName.DEFAULT ||
payload.action !== 'labeled' ||
payload.label?.name !== label
) {
Expand All @@ -32,7 +33,7 @@ export default async (

await bot.github.octokit.rest.issues.createComment({
...extractOwnerRepo(payload),
issue_number: payload.issue.number,
issue_number: payload.pull_request.number,
body: postedComment,
})
}

0 comments on commit 1485d09

Please sign in to comment.