CircleCI-Public / continuation-orb

MIT License
12 stars 15 forks source link

Request: how to dynamically select whether to continue #6

Closed danopia closed 1 year ago

danopia commented 3 years ago

Describe Request:

I am generating a new CircleCI configuration file to give to this orb:

      - continuation/continue:
          configuration_path: ".circleci/continue_config.yml"

Unfortunately, sometimes there are simply no workflows that I'd want to continue into. For example, a PR that only updates README.md will not match any entries in my mapping for path-filtering-orb. In this case CircleCI considers the continued build an error because there is nothing to do:

Screenshot 2021-04-01 at 13 59 24

In this case the documentation says to close out:

      - continuation/finish

These are two different steps - I'm not aware of how to conditionally call steps based on the output of a previous step!

It seems as though this orb should have a third command that can dynamically switch between 'continue' or 'finish' depending on a parameter.

Examples:

Something like this could probably work, if nothing else:

      - run:
          command: echo 'export CONTINUATION_ACTION=continue' >> $BASH_ENV
      - continuation/decide:
          configuration_path: ".circleci/continue_config.yml"
          action: $CONTINUATION_ACTION

I could also imagine there being a special check on the config on disk, for example if .circleci/continue_config.yml is empty (zero bytes) then finish instead of continuing.

Supporting Documentation Links:

Fernando-Abreu commented 1 year ago

I'm closing this issue for now, as our team won't have the capacity to work on this. But feel free to open a PR with this issue tagged.

michaelirey commented 9 months ago

I agree @danopia! Too bad, CircleCI isn't willing to address this.

What is the point of even having finish if there is no when step to control its behavior? continue has this, so it seems like an oversight.

michaelirey commented 9 months ago

The work around I am using generates a config, that just echos "Nothing to do here", but it is a waste of resources to spin up a whole container just so you can "do nothing".