File tree Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Expand file tree Collapse file tree 4 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ root = true
22
33[* ]
44indent_style = space
5- indent_size = 2
5+ indent_size = 4
66end_of_line = lf
77charset = utf-8
88trim_trailing_whitespace = true
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ This action is great for executing migrations or other pre/post deployment steps
7979| --- | --- |
8080| task-arn | The full ARN for the task that was ran. Will be added as ENV variable. |
8181| task-id | The ID for the task that was ran. Will be added as ENV variable. |
82+ | log-output | The log output of the task that was ran, if `tail-logs` was set to true. |
8283<!-- action-docs-outputs -->
8384
8485<!-- action-docs-runs -->
Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ outputs:
5353 description : ' The full ARN for the task that was ran. Will be added as ENV variable.'
5454 task-id :
5555 description : ' The ID for the task that was ran. Will be added as ENV variable.'
56+ log-output :
57+ description : ' The log output of the task that was ran, if `tail-logs` was set to true.'
5658
5759runs :
5860 using : ' node16'
Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ const main = async () => {
6767
6868 // Get logging configuration
6969 let logFilterStream = null ;
70+ let logOutput = null ;
71+
7072 if ( tailLogs ) {
7173 core . debug ( `Logging enabled. Getting logConfiguration from TaskDefinition.` )
7274 let taskDef = await ecs . describeTaskDefinition ( { taskDefinition : taskDefinition } ) . promise ( ) ;
@@ -104,7 +106,9 @@ const main = async () => {
104106 } ) ;
105107
106108 logFilterStream . on ( 'data' , function ( eventObject ) {
107- core . info ( `${ new Date ( eventObject . timestamp ) . toISOString ( ) } : ${ eventObject . message } ` ) ;
109+ const logLine = `${ new Date ( eventObject . timestamp ) . toISOString ( ) } : ${ eventObject . message } `
110+ core . info ( logLine ) ;
111+ logOutput += logLine + '\n' ;
108112 } ) ;
109113
110114 return true ;
@@ -113,6 +117,9 @@ const main = async () => {
113117 }
114118 }
115119
120+ // Set output variable, so it can be used by other actions
121+ core . setOutput ( 'log-output' , logOutput ) ;
122+
116123 // Wait for Task to finish
117124 core . debug ( `Waiting for task to finish.` ) ;
118125 await ecs . waitFor ( 'tasksStopped' , { cluster, tasks : [ taskArn ] } ) . promise ( ) ;
You can’t perform that action at this time.
0 commit comments