Replies: 1 comment
-
Well, I decided in the end just to use the shell to do the 'OR'. Each task depends on a 'prompt-if-dirty' task. This only runs a prompt asking for confirmation, but it has a 'status' clause saying that it doesn't need to do that if either the working directory is clean or the variable is set: prompt-if-dirty:
desc: Check if the git repository is clean and prompt if not.
prompt: The working directory isn't clean - really continue?
run: once
internal: true
silent: true
status:
- test "${ALLOW_UNCLEAN}" == "1" || test -z "$(git status --porcelain)"
That'll do for now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to be able to run a deployment only if EITHER:
(I'd be happy with alternatives to the second one, like having to confirm at a prompt that I really want to go ahead.)
I can specify either of these as a precondition just fine, but if I specify both of them, then they both have to be true.
Is there a good way to do OR, instead of AND, other than combining them both into a complex shell expression?
Instead of using precinditions, I wondered about something like making the deployment task DEPEND on a checking task which normally would run the git test but would use a 'status' clause to check whether it needs to, by looking at the environment variable. I think that might work, but wondered if that was the best way! It might not be very self-explanatory.
Beta Was this translation helpful? Give feedback.
All reactions