Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove AWS SDKv2
  • Loading branch information
Ic3w0lf committed Aug 8, 2024
commit f73c82a0e9f0142df2a3001eebf84b9cab225d16
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[![Geek Cell GmbH](https://raw.githubusercontent.com/geekcell/.github/main/geekcell-github-banner.png)](https://www.geekcell.io/)

[![Linter](https://github.com/geekcell/github-action-aws-ecs-run-task/actions/workflows/linter.yaml/badge.svg)](https://github.com/geekcell/github-action-aws-ecs-run-task/actions/workflows/linter.yaml)
[![Test](https://github.com/geekcell/github-action-aws-ecs-run-task/actions/workflows/test.yaml/badge.svg)](https://github.com/geekcell/github-action-aws-ecs-run-task/actions/workflows/test.yaml)
[![Check dist/](https://github.com/geekcell/github-action-aws-ecs-run-task/actions/workflows/check-dist.yaml/badge.svg)](https://github.com/geekcell/github-action-aws-ecs-run-task/actions/workflows/check-dist.yaml)

<!-- action-docs-description -->
## Description

Expand Down
15 changes: 13 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56578,6 +56578,9 @@ const main = async () => {
return;
}

// Get CWLogsClient
let CWLogClient = new CloudWatchLogsClient();

// Only create logFilterStream if tailLogs is enabled, and we wait for the task to stop in the pipeline
if (tailLogs) {
core.debug(`Logging enabled. Getting logConfiguration from TaskDefinition.`)
Expand Down Expand Up @@ -56612,7 +56615,6 @@ const main = async () => {

// Start Live Tail
try {
const CWLogClient = new CloudWatchLogsClient();
const response = await CWLogClient.send(new StartLiveTailCommand({
logGroupIdentifiers: [logGroupIdentifier],
logStreamNames: [logStreamName]
Expand Down Expand Up @@ -56645,6 +56647,7 @@ const main = async () => {
}

// Close LogStream and store output
CWLogClient.destroy();
core.setOutput('log-output', logOutput);

// Describe Task to get Exit Code and Exceptions
Expand Down Expand Up @@ -56684,7 +56687,15 @@ async function handleCWResponseAsync(response) {
core.error("CWLiveTailSession error: Unknown event type.");
}
} catch (err) {
core.error(err.message)
// If we close the connection, we will get an error with message 'aborted' which we can ignore as it will
// just show as an error in the logs.
if (err.message === 'aborted') {
core.debug("CWLiveTailSession aborted.");

return;
}

core.error(err.name + ": " + err.message);
}
}

Expand Down
15 changes: 13 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ const main = async () => {
return;
}

// Get CWLogsClient
let CWLogClient = new CloudWatchLogsClient();

// Only create logFilterStream if tailLogs is enabled, and we wait for the task to stop in the pipeline
if (tailLogs) {
core.debug(`Logging enabled. Getting logConfiguration from TaskDefinition.`)
Expand Down Expand Up @@ -164,7 +167,6 @@ const main = async () => {

// Start Live Tail
try {
const CWLogClient = new CloudWatchLogsClient();
const response = await CWLogClient.send(new StartLiveTailCommand({
logGroupIdentifiers: [logGroupIdentifier],
logStreamNames: [logStreamName]
Expand Down Expand Up @@ -197,6 +199,7 @@ const main = async () => {
}

// Close LogStream and store output
CWLogClient.destroy();
core.setOutput('log-output', logOutput);

// Describe Task to get Exit Code and Exceptions
Expand Down Expand Up @@ -236,7 +239,15 @@ async function handleCWResponseAsync(response) {
core.error("CWLiveTailSession error: Unknown event type.");
}
} catch (err) {
core.error(err.message)
// If we close the connection, we will get an error with message 'aborted' which we can ignore as it will
// just show as an error in the logs.
if (err.message === 'aborted') {
core.debug("CWLiveTailSession aborted.");

return;
}

core.error(err.name + ": " + err.message);
}
}

Expand Down
Loading