FlowCI / flow-core-x

Powerful and user-friendly CI/CD server with high availability, parallel processing, runner auto-scaling
https://flowci.github.io
Apache License 2.0
1.61k stars 121 forks source link

Question: How to add condition to entire flow #397

Closed luke-riu closed 3 years ago

luke-riu commented 3 years ago

For example. I have a web hook for push requests in GitHub to call https://<url>/webhooks/deploy but I only want the flow to run if the branch name in git is called "deployment". Is there a way to put a condition on the entire flow to only run if it meets a certain condition? I see there is a

condition: |
  return ${branch name}

but that looks like it's only on individual steps. Thanks

luke-riu commented 3 years ago

It turns out this works with real web hooks but not when a flow is run manually.

example:

envs:

condition: |
  return FLOWCI_GIT_BRANCH == "distribute"

steps: