Adding branches to the jobs or the workflow level disable the fork pull request build
version: 2
defaults: &defaults
docker:
- image: circleci/php
jobs:
build:
docker:
- image: circleci/php
# branches:
# only: dev <---- When I add this filter the fork pull request build doesn't work
steps:
- checkout
- run: echo "Start tests - Dev branch"
staging:
<<: *defaults
steps:
- checkout
- run: echo "Deploying to the Staging Server"
prod:
<<: *defaults
steps:
- checkout
- run: echo "Deploying to the Production Server"
workflows:
version: 2
stage_prod:
jobs:
- build
# - build:
# filters:
# branches:
# only: dev <---- When I add this filter the fork pull request build doesn't work
- staging:
filters:
branches:
only: test
- hold:
type: approval
filters:
branches:
only: master
- prod:
requires:
- hold