> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# bjd2385/dynamic-continuation

A CircleCI orb that allows the creation of any number of configs under `.circleci/` that only run when there
are code changes in coinciding directory paths


## Commands

### filter

Filter the list of modules (directories) provided in the shared config to those that contain changes.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `auto-detect` | boolean | false | Auto-detect modules. |
| `base-revision` | string | main | The default branch of the repository. |
| `cache` | boolean | true | Whether or not to cache (i.e. you're calling these commands in your own job, not 'continue'). |
| `circle-organization` | string | $CIRCLE_ORGANIZATION | CircleCI organization to query with your API key. |
| `circle-token` | string | $CIRCLE_TOKEN | Token to authenticate with CircleCI |
| `debug` | boolean | false | Enable debug logging. |
| `force-all` | boolean | false | Forcibly build all the modules |
| `include-config-changes` | boolean | true | Include CircleCI config changes (e.g., scripts.yml) while checking for changed modules. |
| `library-config` | string | cilib | Specify a common configuration file that serves as a library of commands and jobs.

This config is not validated, but rather merged with all other configs (excluding .circleci/config.yml, of course) prior to their validation and execution.
 |
| `modules` | string |  | Directories which should be built upon changes. Auto-detection overrides this listing if enabled. |
| `modules-filtered` | string | /tmp/modules-filtered.txt | Path to the file where the filtered list of modules is generated |
| `project-type` | enum | github | Can be either GitHub (gh), GitLab, or BitBucket (bb). |
| `reporting-window` | enum |  | The time window used to calculate summary metrics for the default branch of the repository. Defaults to disabled. Allows users to force all workflows to run if no workflows have been ran in the time window. |
| `root-config` | string | app | Provides the ability to map root repository changes (./) to a config file name. |
| `squash-merge-lookbehind` | string | 1 | Number of commits back to compare against following squash merges. |
| `wildmatch-version` | string | 0.3.3 | Wildmatch package version to install. For available versions, check PyPI - https://pypi.org/project/wildmatch/ |

### reduce

Merge modules' configs, if there are changed files in the directory, into an additional config under .circleci/ in the
checked-out source,


| Parameter | Type | Default | Description |
|---|---|---|---|
| `auto-detect` | boolean | false | Auto-detect modules. |
| `cache` | boolean | true | Whether or not to cache (i.e. you're calling these commands in your own job, not 'continue'). |
| `circle-token` | string | $CIRCLE_TOKEN | Token to authenticate with CircleCI |
| `continue-config` | string | .circleci/continue-config.yml | Path to the internally-used config for continuation |
| `debug` | boolean | false | Enable debug logging. |
| `library-config` | string |  | Specify a common configuration file that serves as a library of commands and jobs.

This config is not validated, but rather merged with all other configs (excluding .circleci/config.yml, of course) prior to their validation and execution.
 |
| `modules-filtered` | string | /tmp/modules-filtered.txt | Path to the file for the list of the modules to build |
| `project-type` | enum | github | Can be either GitHub (gh) or BitBucket (bb). |
| `root-config` | string | app | Provides the ability to map root repository changes (./) to a config file name. Defaults to app.yml. |

## Jobs

### continue

Merge CircleCI configs at .circleci/*.yml to include other 'modules', then reduce and submit them as a single continuation.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `auto-detect` | boolean | true | Auto-detect modules. |
| `base-revision` | string | main | Default branch of the repository. |
| `circle-organization` | string | $CIRCLE_ORGANIZATION | CircleCI organization to query with your API key. |
| `circle-token` | string | $CIRCLE_TOKEN | Token to authenticate with CircleCI |
| `circleci-cli-version` | string | v0.1.26837 | Version of the CircleCI CLI to install. (Cf. https://github.com/CircleCI-Public/circleci-cli/releases.) |
| `circleci-domain` | string | circleci.com | The domain of the CircleCI installation - defaults to circleci.com. (Only necessary for CircleCI Server users). |
| `continue-config` | string | .circleci/continue-config.yml | Path to the internally-used config for continuation |
| `debug` | boolean | false | Enable debug logging. |
| `executor` | executor | python | The name of the custom executor to use. |
| `force-all` | boolean | false | Forcibly run all modules. |
| `include-config-changes` | boolean | true | Include CircleCI config changes (e.g., scripts.yml) while checking for changed modules. |
| `jq-version` | string | 1.6-2.1ubuntu3 | Version of jq to install. |
| `library-config` | string |  | Specify a common configuration file that serves as a library of commands and jobs.

This config is not validated, but rather merged with all other configs (excluding .circleci/config.yml, of course) prior to their validation and execution.
 |
| `modules` | string |  | Directories which should be tested for changes; one directory per line. Auto-detection overrides this listing if enabled. |
| `modules-filtered` | string | /tmp/modules-filtered.txt | Path to the file where the filtered list of modules is generated |
| `parameters` | string | {} | The parameters used for the pipeline. This can either be a JSON object containing parameters or a path to a file containing a JSON object with parameters. |
| `pre-script` | string |  | A script to run after checkout and before any continuation logic. Script should have a shebang and executable. |
| `project-type` | enum | github | Can be either GitHub (github), GitLab (gitlab), or BitBucket (bitbucket). |
| `reporting-window` | enum |  | The time window used to calculate summary metrics for the default branch of the repository. Defaults to disabled. Allows users to force all workflows to run if no workflows have been ran in the time window. |
| `resource-class` | enum | small | Resource class to run this job with. |
| `root-config` | string | app | Provides the ability to map root repository changes (./) to a config file name. Name should be left without extension. |
| `squash-merge-lookbehind` | string | 1 | Number of commits back to compare against following squash merges. |
| `wildmatch-version` | string | 0.3.3 | Wildmatch package version to install. For available versions, check PyPI - https://pypi.org/project/wildmatch/#description |
| `yq-version` | string | v4.31.1 | Version of yq to install and use for reduction. See the releases page of that project for valid options. (Note: preceeding 'v')

https://github.com/mikefarah/yq/releases
 |

## Executors

### python

Base python CircleCI executor

| Parameter | Type | Default | Description |
|---|---|---|---|
| `tag` | string | 3.10 | Latest Python 3.10 |

## Examples

### example-pipeline

Use the "continue" job to dynamically execute workflows in directories/modules.


```yaml
version: '2.1'
setup: true
orbs:
  dynamic: bjd2385/dynamic-continuation@3.8.0
workflows:
  on-commit:
    jobs:
      - dynamic/continue:
          context: circleci
```