Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
kengo-k committed Jun 1, 2024
1 parent 5357010 commit 593b007
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
7 changes: 4 additions & 3 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 8 additions & 9 deletions internal/get/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function main() {
head: after,
});


const outputs = [];
for (const argObj of argObjs) {
let buildRequired = false;
if (argObj.only_changed) {
Expand All @@ -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));

}

Expand Down

0 comments on commit 593b007

Please sign in to comment.