Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/helpers/webhookHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { getPullRequestData } from './pullRequest.js';
import { setCommitStatus, getLatestCommitSha } from './github.js';
import { updateOrCreateWorlddrivenComment } from './commentManager.js';
import { Repository } from '../database/models.js';
import { Auth } from './auth.js';
import { GitHubClient } from './github-client.js';

/**
* Set GitHub status for a pull request
Expand Down Expand Up @@ -68,8 +70,12 @@ async function setPullRequestStatus(
async function processPullRequest(installationId, owner, repo, pullNumber) {
console.log(`Processing PR ${owner}/${repo}#${pullNumber} from webhook`);

// Create Auth and GitHubClient for this repository
const auth = new Auth({ owner, repo });
const githubClient = new GitHubClient(auth);

const pullRequestData = await getPullRequestData(
installationId,
githubClient,
owner,
repo,
pullNumber
Expand Down