Skip to content

Commit

Permalink
chore: use docker-run-action
Browse files Browse the repository at this point in the history
  • Loading branch information
bsherman committed Apr 9, 2024
1 parent a089b1d commit b45101f
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,25 @@ jobs:
- name: Get current version
id: labels
uses: docker://${{ FQ_SOURCE_IMAGE }}
shell: bash
run: |
set -eo pipefail
skopeo inspect docker://${{ env.FQ_SOURCE_IMAGE }} > inspect.json
ver=$(jq -r '.Labels["org.opencontainers.image.version"]' inspect.json)
linux=$(jq -r '.Labels["ostree.linux"]' inspect.json)
if [ -z "$ver" ] || [ "null" = "$ver" ]; then
echo "inspected image version must not be empty or null"
exit 1
fi
if [ -z "$linux" ] || [ "null" = "$linux" ]; then
echo "inspected image linux version must not be empty or null"
exit 1
fi
echo "SOURCE_IMAGE_VERSION=$ver" >> $GITHUB_ENV
echo "SOURCE_IMAGE_LINUX=$linux" >> $GITHUB_ENV
uses: addnab/docker-run-action@v3
with:
image: ${{ FQ_SOURCE_IMAGE }}
shell: bash
run: |
set -eo pipefail
skopeo inspect docker://${{ env.FQ_SOURCE_IMAGE }} > inspect.json
ver=$(jq -r '.Labels["org.opencontainers.image.version"]' inspect.json)
linux=$(jq -r '.Labels["ostree.linux"]' inspect.json)
if [ -z "$ver" ] || [ "null" = "$ver" ]; then
echo "inspected image version must not be empty or null"
exit 1
fi
if [ -z "$linux" ] || [ "null" = "$linux" ]; then
echo "inspected image linux version must not be empty or null"
exit 1
fi
echo "SOURCE_IMAGE_VERSION=$ver" >> $GITHUB_ENV
echo "SOURCE_IMAGE_LINUX=$linux" >> $GITHUB_ENV
# Build metadata
- name: Image Metadata
Expand Down

0 comments on commit b45101f

Please sign in to comment.