From a98848f3417c66dc2fe3e7bded1edb233ae80537 Mon Sep 17 00:00:00 2001 From: Trajano Reuter Date: Fri, 30 Jun 2023 15:06:40 -0300 Subject: [PATCH] feat: add console debug --- index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 272337d..49cfabb 100644 --- a/index.js +++ b/index.js @@ -55,12 +55,12 @@ const getECSService = async ({ async function run() { - const aws_region = core.getInput('region') const cluster = core.getInput('cluster-name') const service = core.getInput('service-name') const task = core.getInput('task-name') + console.log('Start client with region', aws_region) const client = new ECSClient({ region: aws_region }) try { @@ -71,15 +71,20 @@ async function run() { client }) const { taskDefinition } = head(services) + console.log('Task definition from services', taskDefinition) const taskDef = await getTaskDefinition({ taskDefinition, client, }) + console.log('Task definition from task', taskDef) + const replacements = core.getInput('replacements') || '{}' const taskDefMerged = merge(taskDef, JSON.parse(replacements)) + console.log('Task definition merged', taskDefMerged) const newTaskDef = omit(taskDefMerged, IGNORED_TASK_DEFINITION_ATTRIBUTES) + console.log('Task definition merged and cleaned', newTaskDef) // create a a file for task def const taskDefFile = tmp.fileSync({ @@ -93,12 +98,13 @@ async function run() { fs.writeFileSync(taskDefFile.name, JSON.stringify(newTaskDef)) core.setOutput('taskDef', taskDefFile.name) } else { - const taskDef = await getTaskDefinition({ taskDefinition: task, client, }) + console.log('Task definition from task', taskDef) + const replacements = core.getInput('replacements') || '{}' const taskDefMerged = merge(taskDef, JSON.parse(replacements))