From 593b007cedfa8d3ebd8c83fef9afad1e64cd5ecc Mon Sep 17 00:00:00 2001 From: kengo-k <31839234+kengo-k@users.noreply.github.com> Date: Sat, 1 Jun 2024 21:30:55 +0900 Subject: [PATCH] chore --- action.yaml | 7 ++++--- internal/get/index.js | 17 ++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/action.yaml b/action.yaml index 41f768b..48260ec 100644 --- a/action.yaml +++ b/action.yaml @@ -22,7 +22,8 @@ runs: run: | output_array='${{ steps.js_action.outputs.docker_command }}' echo "$output_array" | jq -c '.[]' | while read -r element; do - key1=$(echo "$element" | jq -r '.key1') - key2=$(echo "$element" | jq -r '.key2') - echo "Key1: $key1, Key2: $key2" + path=$(echo "$element" | jq -r '.path') + name=$(echo "$element" | jq -r '.name') + tag=$(echo "$element" | jq -r '.tag') + echo "path: $path, name: $name, tag: $tag" done diff --git a/internal/get/index.js b/internal/get/index.js index b5e1abd..29ea782 100644 --- a/internal/get/index.js +++ b/internal/get/index.js @@ -35,7 +35,7 @@ async function main() { head: after, }); - + const outputs = []; for (const argObj of argObjs) { let buildRequired = false; if (argObj.only_changed) { @@ -59,18 +59,17 @@ async function main() { if (argObj.with_commit_sha) { imageTags.push(after); } - const imageTag = imageTags.join('-'); - const buildArgs = ['build', '-f', argObj.path, '-t', `${argObj.name}:${imageTag}`, '.']; + const tag = imageTags.join('-'); console.log('Current directory:', process.cwd()); - const outputArray = [ - { key1: 'value1', key2: 'value2' }, - { key1: 'value3', key2: 'value4' } - ]; - - setOutput('docker_command', JSON.stringify(outputArray)); + outputs.push({ + path: argObj.path, + name: argObj.name, + tag, + }); } } + setOutput('docker_command', JSON.stringify(outputs)); }