-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit aab5033
Showing
13 changed files
with
719 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: 'Fetch task definition' | ||
description: 'Fetch task definition from ECS' | ||
inputs: | ||
name: | ||
description: 'Name of the task definition' | ||
required: true | ||
filename: | ||
description: 'Name of the file to store the task definition' | ||
required: false | ||
default: 'task_definition.json' | ||
outputs: | ||
filename: | ||
description: 'Task definition filename' | ||
runs: | ||
using: 'node12' | ||
main: 'index.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const core = require('@actions/core') | ||
const childProcess = require('child_process') | ||
|
||
async function run() { | ||
try { | ||
const taskDefinitionName = core.getInput('name', {required: true}) | ||
const filename = core.getInput('filename') | ||
|
||
childProcess.execSync( | ||
`aws ecs describe-task-definition --task-definition ${taskDefinitionName} | \\ | ||
jq '.taskDefinition|del(.compatibilities,.taskDefinitionArn,.requiresAttributes,.revision,.status)' \\ | ||
> ${filename}` | ||
) | ||
|
||
core.setOutput('filename', filename) | ||
} catch (error) { | ||
core.setFailed(error.message) | ||
} | ||
} | ||
|
||
module.exports = run | ||
|
||
if (require.main === module) { | ||
run() | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
146 changes: 146 additions & 0 deletions
146
fetch-task-definition/node_modules/@actions/core/README.md
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
fetch-task-definition/node_modules/@actions/core/lib/command.d.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
92 changes: 92 additions & 0 deletions
92
fetch-task-definition/node_modules/@actions/core/lib/command.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
fetch-task-definition/node_modules/@actions/core/lib/command.js.map
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.