Skip to content

Commit 7581010

Browse files
committed
Replace extract-image-names.sh with JS script
1 parent 0639149 commit 7581010

File tree

2 files changed

+13
-64
lines changed

2 files changed

+13
-64
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,16 @@ jobs:
7373
build.json
7474
.github/workflows/env.hcl
7575
76-
- name: Set output image names
77-
id: bake_metadata
78-
# bake-action metadata output has gotten too big, so we first write it
79-
# to a file. See https://github.com/aiidalab/aiidalab-docker-stack/issues/491
80-
run: |
81-
cat << EOF > bake_metadata.json
82-
${{ steps.build-upload.outputs.metadata }}
83-
EOF
84-
images=$(.github/workflows/extract-image-names.sh bake_metadata.json)
85-
echo "images=${images}" >> "${GITHUB_OUTPUT}"
86-
# Pretty-print for GHA logs
87-
echo "$images" | jq
76+
- name: Set output variables
77+
uses: actions/github-script@v7
78+
with:
79+
script: |
80+
const data = JSON.parse(process.env.BAKE_METADATA,'utf-8')
81+
for (const key in JSON.parse(process.env.BAKE_METADATA || '{}', 'utf-8')) {
82+
if (data.hasOwnProperty(key)) {
83+
const entry = data[key];
84+
core.setOutput(`${key.toUpperCase().replace(/-/g, "_")}_IMAGE`, `${entry["image.name"]}@${entry["containerimage.digest"]}`);
85+
}
86+
}
87+
env:
88+
BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }}

.github/workflows/extract-image-names.sh

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)