Skip to content

Commit

Permalink
Use download output
Browse files Browse the repository at this point in the history
  • Loading branch information
dbieber committed Feb 1, 2025
1 parent 23df283 commit bc9e446
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,18 @@ runs:
CACHE_IMAGE_PATH="$CACHE_DIR/$BASE_IMAGE_FILENAME"
if [ -f "$CACHE_IMAGE_PATH" ]; then
echo "Base image found in cache: $CACHE_IMAGE_PATH"
echo "image=$CACHE_IMAGE_PATH" >> "$GITHUB_OUTPUT"
else
echo "Downloading base image: ${{ inputs.base_image }}"
DOWNLOADED_IMAGE=$(bash ${GITHUB_ACTION_PATH}/download_image.sh "${{ inputs.base_image }}")
bash ${GITHUB_ACTION_PATH}/download_image.sh "${{ inputs.base_image }}"
# Read the last line starting with "image=" from GITHUB_OUTPUT to get the downloaded image path.
DOWNLOADED_IMAGE=$(grep '^image=' "$GITHUB_OUTPUT" | tail -n1 | cut -d'=' -f2)
if [ -z "$DOWNLOADED_IMAGE" ]; then
echo "Error: download_image.sh did not output a valid image path."
exit 1
fi
cp "$DOWNLOADED_IMAGE" "$CACHE_IMAGE_PATH"
fi
echo "::set-output name=image::$CACHE_IMAGE_PATH"
shell: bash
- name: Mount and optionally resize image
run: |
Expand Down

0 comments on commit bc9e446

Please sign in to comment.