Skip to content

Commit

Permalink
fix tiny bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bemijonathan committed May 12, 2024
1 parent 863b2be commit 47b381e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import dotenv from 'dotenv'
import { Logger, Templates } from './utils.js'
import { Ai } from './ai'
import { BaseClient, GithubClient } from './clients'
import { mockdata } from './mockdata'

dotenv.config()

Expand All @@ -32,10 +31,10 @@ const getClientInstance = () => {}

export async function run(): Promise<void> {
try {
const githubContext =
process.env.NODE_ENV === 'local' ? mockdata : github.context
const githubContext = github.context
const pullRequestNumber = githubContext.payload.pull_request?.number
if (!pullRequestNumber || githubContext.payload) {

if (!pullRequestNumber || !githubContext.payload) {
Logger.warn('Could not get pull request number from context, exiting')
return
}
Expand Down

0 comments on commit 47b381e

Please sign in to comment.