Skip to content

Commit

Permalink
Better handling of fallback not existing (#19)
Browse files Browse the repository at this point in the history
* Don't check image tag if tag_fallback isn't specified

* Better handling of fallback not existing
  • Loading branch information
pauldaustin authored Jun 1, 2023
1 parent 0ba3a30 commit 107ead9
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,18 @@ runs:
echo " b) triggers not provided"
echo "triggered=true" >> $GITHUB_OUTPUT
exit 0
fi
# Build if tag_fallback is no good (requires a valid container)
if [ $(docker buildx imagetools inspect ghcr.io/${{ inputs.repository }}/${{ inputs.package }}:${{ inputs.tag_fallback }} > /dev/null) -ne 0 ]
then
# Output triggered=true for next steps
echo "Build triggered. Fallback tag (tag_fallback) not usable."
echo "Manifest checked for: ghcr.io/${{ inputs.repository }}/${{ inputs.package }}:${{ inputs.tag_fallback }}"
echo "triggered=true" >> $GITHUB_OUTPUT
exit 0
else
# Build if tag_fallback is no good (requires a valid container)
docker buildx imagetools inspect ghcr.io/${{ inputs.repository }}/${{ inputs.package }}:${{ inputs.tag_fallback }} > /dev/null 2>&1
if [ $? -ne 0 ]
then
# Output triggered=true for next steps
echo "Build triggered. Fallback tag (tag_fallback) not usable."
echo "Manifest checked for: ghcr.io/${{ inputs.repository }}/${{ inputs.package }}:${{ inputs.tag_fallback }}"
echo "triggered=true" >> $GITHUB_OUTPUT
exit 0
fi
fi
# Build if changed files (git diff) match triggers
Expand Down

0 comments on commit 107ead9

Please sign in to comment.