Skip to main content

Can I change the value of circleci_ip_ranges based on the branch?

Changing IP Ranges Based on Branch

You can utilize the workflow filtering feature to allow only specific jobs containing circleci_ip_ranges: true to run.

Example

The following example should enable a workflow where depoly_prod would only run on main branch. All the other branches will simply run deploy_dev and main branch would not run:

workflows:
version: 2
dev-prod:
jobs:
- deploy_dev:
filters:
branches:
ignore: main
- deploy_prod:
filters:
branches:
only: main

Additional Resources

Did this answer your question?