factoriotools / factorio-docker

Factorio headless server in a Docker container
https://hub.docker.com/r/factoriotools/factorio/
MIT License
909 stars 220 forks source link

Skip pushing to docker hub when user and pass are not specified #418

Closed perobertson closed 2 years ago

perobertson commented 2 years ago

When I have been syncing my fork I noticed that the GitHub actions were running on the master branch and failing. This changes the workflows so that it will only try pushing if the secrets are specified.

You can see some example flows here where I was forcing it to run on any push for testing

Ideally I would use jobs.<job_id>.if to specify the condition, but I could not find a way to see if the secrets were available. The next best thing was to use jobs.<job_id>.steps.if and check if an environment was available.