@@ -22,9 +22,10 @@ function runBuild() {
2222
2323 const inputs = githubInputs ( ) ;
2424
25- const config = ( ( { updateInterval, updateBackOff } ) => ( {
25+ const config = ( ( { updateInterval, updateBackOff, hideCloudWatchLogs } ) => ( {
2626 updateInterval,
2727 updateBackOff,
28+ hideCloudWatchLogs,
2829 } ) ) ( inputs ) ;
2930
3031 // Get input options for startBuild
@@ -44,7 +45,7 @@ async function build(sdk, params, config) {
4445async function waitForBuildEndTime (
4546 sdk ,
4647 { id, logs } ,
47- { updateInterval, updateBackOff } ,
48+ { updateInterval, updateBackOff, hideCloudWatchLogs } ,
4849 seqEmptyLogs ,
4950 totalEvents ,
5051 throttleCount ,
@@ -62,13 +63,12 @@ async function waitForBuildEndTime(
6263 const { logGroupName, logStreamName } = logName ( cloudWatchLogsArn ) ;
6364
6465 let errObject = false ;
65-
6666 // Check the state
6767 const [ batch , cloudWatch = { } ] = await Promise . all ( [
6868 codeBuild . batchGetBuilds ( { ids : [ id ] } ) . promise ( ) ,
69- // The CloudWatchLog _may_ not be set up, only make the call if we have a logGroupName
70- logGroupName &&
71- cloudWatchLogs
69+ ! hideCloudWatchLogs &&
70+ logGroupName &&
71+ cloudWatchLogs // only make the call if hideCloudWatchLogs is not enabled and a logGroupName exists
7272 . getLogEvents ( {
7373 logGroupName,
7474 logStreamName,
@@ -155,7 +155,7 @@ async function waitForBuildEndTime(
155155 return waitForBuildEndTime (
156156 sdk ,
157157 current ,
158- { updateInterval, updateBackOff } ,
158+ { updateInterval, updateBackOff, hideCloudWatchLogs } ,
159159 seqEmptyLogs ,
160160 totalEvents ,
161161 throttleCount ,
@@ -210,6 +210,9 @@ function githubInputs() {
210210 10
211211 ) * 1000 ;
212212
213+ const hideCloudWatchLogs =
214+ core . getInput ( "hide-cloudwatch-logs" , { required : false } ) === "true" ;
215+
213216 return {
214217 projectName,
215218 owner,
@@ -223,6 +226,7 @@ function githubInputs() {
223226 updateInterval,
224227 updateBackOff,
225228 disableSourceOverride,
229+ hideCloudWatchLogs,
226230 } ;
227231}
228232
0 commit comments