Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed May 8, 2024
1 parent 657eb35 commit 73a4642
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
timeout-minutes: 30

outputs:
image: ${{ steps.build-upload.outputs.image }}
image: ${{ steps.bake_metadata.outputs.image }}

steps:
- name: Checkout Repo ⚡️
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Set output variables
id: bake_metadata
run: |
.github/workflows/extract-image-names.sh | tee -a "${GITHUB_OUTPUT}"
.github/workflows/extract-image-name.sh | tee -a "${GITHUB_OUTPUT}"
env:
BAKE_METADATA: ${{ steps.build-upload.outputs.metadata }}

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/extract-image-name.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
#
# Example output (real output is on one line):
#
# image={
# "BUILD_MACHINE_IMAGE": "ghcr.io/pspgen/base@sha256:8e57a52b924b67567314b8ed3c968859cad99ea13521e60bbef40457e16f391d",
# image="ghcr.io/pspgen/build-machine@sha256:79a0f984b9e03b733304fda809ad3e8eec8416992ff334052d75da00cadb8f12"
# }
#
# This json output is later turned to environment variables using fromJson() GHA builtin
Expand All @@ -31,5 +30,5 @@ if [[ -z ${BAKE_METADATA-} ]];then
exit 1
fi

image=$(echo "${BAKE_METADATA}" | 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')
image=$(echo "${BAKE_METADATA}" | jq -c '. as $base | [to_entries[] | [(.value."image.name"|split(",")[0]),(.value."containerimage.digest")]|join("@")]'
echo "image=$image"

0 comments on commit 73a4642

Please sign in to comment.