From 99ae2f6399d26b7e4ddbc0d1401d202d89480a3b Mon Sep 17 00:00:00 2001 From: Ori Hoch Date: Wed, 9 Nov 2022 19:04:49 +0200 Subject: [PATCH] prevent failure of script due to missing permissions to push Docker image --- php-build.bash | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php-build.bash b/php-build.bash index 96da117..d68c14e 100644 --- a/php-build.bash +++ b/php-build.bash @@ -110,4 +110,7 @@ echo "$dockerfile" >> output.log 2>&1 docker build --tag "$docker_tag" --cache-from "$docker_tag" --file Dockerfile-php-build . >> output.log 2>&1 # Update the user's repository with the customised docker image, ready for the # next Github Actions run. -docker push "$docker_tag" >> output.log 2>&1 +if ! docker push "$docker_tag" >> output.log 2>&1; then + echo "WARNING: Failed to push Docker image to \"$docker_tag\", this is probably due to missing permissions on GitHub." >> output.log 2>&1 + echo "Will continue as this is just an optimization to improve speed of next build." >> output.log 2>&1 +fi