Skip to content

Commit 1b70cd0

Browse files
authored
Merge pull request #1 from geekcell/add-log-output-var
Add log output var
2 parents 5ed0126 + 191acfa commit 1b70cd0

File tree

6 files changed

+55
-5
lines changed

6 files changed

+55
-5
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ root = true
22

33
[*]
44
indent_style = space
5-
indent_size = 2
5+
indent_size = 4
66
end_of_line = lf
77
charset = utf-8
88
trim_trailing_whitespace = true

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
##############################
3+
## Dependabot configuration ##
4+
##############################
5+
6+
#
7+
# Documentation:
8+
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates
9+
#
10+
11+
version: 2
12+
updates:
13+
# Maintain dependencies for GitHub Actions
14+
- package-ecosystem: "github-actions"
15+
directory: "/"
16+
schedule:
17+
interval: "daily"
18+
open-pull-requests-limit: 0
19+
20+
# Maintain dependencies for NPM
21+
- package-ecosystem: "npm"
22+
directory: "/"
23+
schedule:
24+
interval: "daily"
25+
open-pull-requests-limit: 0

.github/pull_request-template.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!-- Please ensure your PR title is brief and descriptive for a good changelog entry -->
2+
<!-- Link to issue if there is one -->
3+
4+
## What it solves
5+
6+
...
7+
8+
## Readiness Checklist
9+
10+
### Author/Contributor
11+
- [ ] If documentation is needed for this change, has that been included in this pull request
12+
- [ ] Pull request title is brief and descriptive (for a changelog entry)
13+
14+
### Reviewing Maintainer
15+
- [ ] Label as `breaking` if this is a large fundamental change
16+
- [ ] Label as either `automation`, `bug`, `documentation`, or `enhancement`
17+
- [ ] Label as `bump:patch`, `bump:minor`, or `bump:major` if this PR should create a new release

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
![Geek Cell GmbH](https://uploads-ssl.webflow.com/61d1d8051145e270217e36a1/61d205833226d492ab02ad46_Group%202.svg "Geek Cell GmbH")
2-
3-
It's 100% Open Source and licensed under the [APACHE2](LICENSE).
1+
[![Geek Cell GmbH](https://raw.githubusercontent.com/geekcell/.github/main/geekcell-github-banner.png)](https://www.geekcell.io/)
42

53
<!-- action-docs-description -->
64
## Description
@@ -79,6 +77,7 @@ This action is great for executing migrations or other pre/post deployment steps
7977
| --- | --- |
8078
| task-arn | The full ARN for the task that was ran. Will be added as ENV variable. |
8179
| task-id | The ID for the task that was ran. Will be added as ENV variable. |
80+
| log-output | The log output of the task that was ran, if `tail-logs` was set to true. |
8281
<!-- action-docs-outputs -->
8382

8483
<!-- action-docs-runs -->

action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

5759
runs:
5860
using: 'node16'

index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)