@@ -40,20 +40,15 @@ async function run() {
40
40
assertEnvVarsDefined ( environmentVariables ) ;
41
41
42
42
const accountName = core . getInput ( accountNameENV ) ;
43
- console . log ( "---1" ) ;
44
43
45
44
const blobServiceClient = new BlobServiceClient (
46
45
`https://${ accountName } .blob.core.windows.net` ,
47
46
new DefaultAzureCredential ( )
48
47
) ;
49
- console . log ( "---2" ) ;
50
48
51
49
const containerName = core . getInput ( containerNameEnv ) ;
52
- console . log ( "---3" ) ;
53
50
const containerClient = blobServiceClient . getContainerClient ( containerName ) ;
54
- console . log ( "---4" ) ;
55
51
const blobBaseName = core . getInput ( blobBaseNameEnv ) ;
56
- console . log ( "---5" ) ;
57
52
58
53
try {
59
54
const inputsContainerClient = blobServiceClient . getContainerClient (
@@ -62,24 +57,24 @@ async function run() {
62
57
const inputsPath = await upload . run ( core . getInput ( inputsPathEnv ) , inputsContainerClient ) ;
63
58
const dependenciesPath = await upload . run ( core . getInput ( dependenciesPathEnv ) , inputsContainerClient ) ;
64
59
65
- // const subcommand = core.getInput('subcommand');
66
- // if (subcommand === 'synchronous') {
67
- // const clientWorkflowId = await submit.run(containerClient, blobBaseName, workflowPath, inputsPath, dependenciesPath);
68
- // await monitor.run(containerClient, clientWorkflowId);
69
- // } else if (subcommand === 'submit') {
70
- // const clientWorkflowId = await submit.run(containerClient, blobBaseName, workflowPath, inputsPath, dependenciesPath);
71
- // core.setOutput('workflowId', clientWorkflowId);
72
- // } else if (subcommand === 'monitor') {
73
- // const clientWorkflowId = core.getInput("workflow_id");
74
- // if (!clientWorkflowId) {
75
- // const msg = "workflow_id environment variable not defined.";
76
- // core.sefFailed(msg);
77
- // throw new Error(msg);
78
- // }
79
- // await monitor.run(containerClient, clientWorkflowId);
80
- // } else {
81
- // throw new Error(`Unknown subcommand: ${subcommand}`);
82
- // }
60
+ const subcommand = core . getInput ( 'subcommand' ) ;
61
+ if ( subcommand === 'synchronous' ) {
62
+ const clientWorkflowId = await submit . run ( containerClient , blobBaseName , workflowPath , inputsPath , dependenciesPath ) ;
63
+ await monitor . run ( containerClient , clientWorkflowId ) ;
64
+ } else if ( subcommand === 'submit' ) {
65
+ const clientWorkflowId = await submit . run ( containerClient , blobBaseName , workflowPath , inputsPath , dependenciesPath ) ;
66
+ core . setOutput ( 'workflowId' , clientWorkflowId ) ;
67
+ } else if ( subcommand === 'monitor' ) {
68
+ const clientWorkflowId = core . getInput ( "workflow_id" ) ;
69
+ if ( ! clientWorkflowId ) {
70
+ const msg = "workflow_id environment variable not defined." ;
71
+ core . sefFailed ( msg ) ;
72
+ throw new Error ( msg ) ;
73
+ }
74
+ await monitor . run ( containerClient , clientWorkflowId ) ;
75
+ } else {
76
+ throw new Error ( `Unknown subcommand: ${ subcommand } ` ) ;
77
+ }
83
78
} catch ( error ) {
84
79
console . error ( 'Error in main script:' , error ) ;
85
80
core . setFailed ( error . message ) ;
0 commit comments