Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
leonid-shevtsov committed Jun 12, 2020
0 parents commit aab5033
Show file tree
Hide file tree
Showing 13 changed files with 719 additions and 0 deletions.
16 changes: 16 additions & 0 deletions fetch-task-definition/action.yml
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'
25 changes: 25 additions & 0 deletions fetch-task-definition/index.js
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()
}
16 changes: 16 additions & 0 deletions fetch-task-definition/node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

146 changes: 146 additions & 0 deletions 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.

21 changes: 21 additions & 0 deletions 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.

92 changes: 92 additions & 0 deletions 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.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit aab5033

Please sign in to comment.