Closed ashishjullia closed 1 year ago
I've a few more ARGs and when I'm changing there values it is getting updated in the image but not for this one.
I even passed the hardcoded value for "MYSQL_HOST=hello"
and at the same time I updated the value for other ARGs, the other ones are getting updated but not this^ one.
There was some issue with my setup, I was able to fix that but still, if an empty value is passed can that be cached as an error?
if an empty value is passed can that be cached as an error?
Not sure why you would like to pass MYSQL_HOST
in your Dockerfile during build. This is a runtime env from what I see and should be handled in your entrypoint script. But anyway you can do that validation in your Dockerfile like:
ARG MYSQL_HOST
RUN if [ -z "$MYSQL_HOST" ] ; then echo "The MYSQL_HOST argument is missing!" ; exit 1; fi
ENV MYSQL_HOST=$MYSQL_HOST
RUN chmod +x entrypoint.sh
Troubleshooting
Before submitting a bug report please read the Troubleshooting doc.
Behaviour
Steps to reproduce this issue
yaml
provided belowAlso, here is the
Dockerfile
Expected behaviour
If there is the empty value for ${{ env.MYSQL_HOST }} then the build step should not proceed, means if should check the value being empty or not
Actual behaviour
The image is being built even if the value is empty for ${{ env.MYSQL_HOST }}
Configuration
Logs
I'm not sure whether such checks can be directly performed using this action or a separate step will be required just to check whether the values being passed are empty of not.