Skip to content

Commit

Permalink
Use digest to identify image
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas committed Apr 18, 2024
1 parent 30431aa commit 28c0050
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ jobs:
- name: Set output variables
id: bake_metadata
env:
BAKE_META: ${{ steps.build-amd64.outputs.metadata }}
# TODO: Make this into a shell script
run: |
cat docker-bake-template-meta.json \
| jq -c '.target | [to_entries[] | {"key": (.key|split("-")[:-1] | join("-")), "value": [.value.tags[]][1]}] | from_entries' \
| tee bake-meta.json
targets=$(echo $(cat bake-meta.json | jq -c 'keys'))
images=$(echo $(cat bake-meta.json | jq -c '. | [to_entries[] | {"key": (.key| split("-")| join("_") |ascii_upcase + "_IMAGE"), "value": .value}] | from_entries'))
targets=$(echo "${BAKE_META}"| jq -c 'keys')
images=$(echo "${BAKE_META}"| jq -c '. as $base |[to_entries[] |{"key": (.key|ascii_upcase|sub("-"; "_"; "g") + "_IMAGE"), "value": [(.value."image.name"|split(",")[0]),.value."containerimage.digest"]|join("@")}] |from_entries')
echo -e "targets=$targets\nimages=$images"
echo "targets=$targets" >> "${GITHUB_OUTPUT}"
echo "images=$images" >> "${GITHUB_OUTPUT}"
Expand Down

0 comments on commit 28c0050

Please sign in to comment.