@@ -10,7 +10,7 @@ import { getGitHubVersion } from "./api-client";
1010import { determineAutobuildLanguages , runAutobuild } from "./autobuild" ;
1111import { getCodeQL } from "./codeql" ;
1212import { Config , getConfig } from "./config-utils" ;
13- import { EnvVar } from "./environment" ;
13+ import { EnvVar , type Env } from "./environment" ;
1414import { Language } from "./languages" ;
1515import { Logger } from "./logging" ;
1616import {
@@ -26,7 +26,6 @@ import {
2626 checkDiskUsage ,
2727 checkGitHubVersionInRange ,
2828 ConfigurationError ,
29- initializeEnvironment ,
3029 wrapError ,
3130} from "./util" ;
3231
@@ -38,14 +37,15 @@ interface AutobuildStatusReport extends StatusReportBase {
3837}
3938
4039async function sendCompletedStatusReport (
40+ env : Env ,
4141 config : Config | undefined ,
4242 logger : Logger ,
4343 startedAt : Date ,
4444 allLanguages : string [ ] ,
4545 failingLanguage ?: string ,
4646 cause ?: Error ,
4747) {
48- initializeEnvironment ( getActionVersion ( ) ) ;
48+ env . initialise ( getActionVersion ( ) ) ;
4949
5050 const status = getActionsStatus ( cause , failingLanguage ) ;
5151 const statusReportBase = await createStatusReportBase (
@@ -129,6 +129,7 @@ async function run({
129129 `We were unable to automatically build your code. Please replace the call to the autobuild action with your custom build steps. ${ error . message } ` ,
130130 ) ;
131131 await sendCompletedStatusReport (
132+ env ,
132133 config ,
133134 logger ,
134135 startedAt ,
@@ -141,7 +142,13 @@ async function run({
141142
142143 env . export ( EnvVar . AUTOBUILD_DID_COMPLETE_SUCCESSFULLY , "true" ) ;
143144
144- await sendCompletedStatusReport ( config , logger , startedAt , languages ?? [ ] ) ;
145+ await sendCompletedStatusReport (
146+ env ,
147+ config ,
148+ logger ,
149+ startedAt ,
150+ languages ?? [ ] ,
151+ ) ;
145152}
146153
147154/** Defines the `autobuild` Action. */
0 commit comments