@@ -2,6 +2,7 @@ import * as fs from "fs";
22import * as path from "path" ;
33import { performance } from "perf_hooks" ;
44
5+ import * as github from "@actions/github" ;
56import * as io from "@actions/io" ;
67import del from "del" ;
78import * as yaml from "js-yaml" ;
@@ -245,25 +246,26 @@ async function finalizeDatabaseCreation(
245246/**
246247 * Set up the diff-informed analysis feature.
247248 *
248- * @param baseRef The base branch name, used for calculating the diff range.
249- * @param headLabel The label that uniquely identifies the head branch across
250- * repositories, used for calculating the diff range.
251- * @param codeql
252- * @param logger
253- * @param features
254249 * @returns Absolute path to the directory containing the extension pack for
255250 * the diff range information, or `undefined` if the feature is disabled.
256251 */
257252export async function setupDiffInformedQueryRun (
258- baseRef : string ,
259- headLabel : string ,
260253 codeql : CodeQL ,
261254 logger : Logger ,
262255 features : FeatureEnablement ,
263256) : Promise < string | undefined > {
264257 if ( ! ( await features . getValue ( Feature . DiffInformedQueries , codeql ) ) ) {
265258 return undefined ;
266259 }
260+
261+ const pull_request = github . context . payload . pull_request ;
262+ if ( ! pull_request ) {
263+ return undefined ;
264+ }
265+
266+ const baseRef = pull_request . base . ref as string ;
267+ const headLabel = pull_request . head . label as string ;
268+
267269 return await withGroupAsync (
268270 "Generating diff range extension pack" ,
269271 async ( ) => {
0 commit comments