@@ -60,22 +60,7 @@ export function getOptionalEnvVariable(name: string, defaultValue: string) {
6060}
6161
6262export async function callLaceworkCli ( ...args : string [ ] ) {
63- const accountName = getRequiredEnvVariable ( 'LW_ACCOUNT_NAME' )
64- const apiKey = getRequiredEnvVariable ( 'LW_API_KEY' )
65- const apiSecret = getRequiredEnvVariable ( 'LW_API_SECRET' )
66- const expandedArgs = [
67- '--noninteractive' ,
68- '--account' ,
69- accountName ,
70- '--api_key' ,
71- apiKey ,
72- '--api_secret' ,
73- apiSecret ,
74- 'sca' ,
75- ...args ,
76- ]
77- info ( 'Calling lacework ' + expandedArgs . join ( ' ' ) )
78- await callCommand ( 'lacework' , ...expandedArgs )
63+ await callCommand ( 'lacework' , '--noninteractive' , 'sca' , ...args )
7964}
8065
8166export function getOrDefault ( name : string , defaultValue : string ) {
@@ -93,7 +78,7 @@ export function generateUILink() {
9378
9479 if ( targetBranch !== defaultBranch ) return ''
9580
96- let lwAccountName = process . env . LW_ACCOUNT_NAME
81+ let lwAccountName = process . env . LW_ACCOUNT
9782 lwAccountName = lwAccountName ?. replace ( / \. l a c e w o r k \. n e t $ / , '' )
9883
9984 let url =
@@ -102,8 +87,8 @@ export function generateUILink() {
10287 `github.com%2F${ context . repo . owner } %2F${ context . repo . repo } ` +
10388 `/${ defaultBranch } `
10489
105- if ( process . env . LW_SUBACCOUNT_NAME ) {
106- url += '?accountName=' + process . env . LW_SUBACCOUNT_NAME
90+ if ( process . env . LW_SUBACCOUNT ) {
91+ url += '?accountName=' + process . env . LW_SUBACCOUNT
10792 }
10893
10994 return url
0 commit comments