I am using the MacOS environment to run a workflow for my iOS app. The problem is the filters don’t seem to prevent the workflow from running when I push to a branch that shouldn’t cause it to run. For example, it should only run when pushed to the master branch but when I push to the develop branch it runs. Why??
Here is my code:
version: 2.1
jobs:
test:
macos:
xcode: "10.1.0"
working_directory: /Users/distiller/project
environment:
FL_OUTPUT_DIR: output
FASTLANE_LANE: test
shell: /bin/bash --login -o pipefail
steps:
- checkout
- restore_cache:
key: 1-gems-{{ checksum "Gemfile.lock" }}
- run:
name: Install Gemfile for Fastlane
command: bundle check || bundle install --path vendor/bundle
- save_cache:
key: 1-gems-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- restore_cache:
key: 1-pods-{{ checksum "Podfile.lock" }}
- run:
name: Install CocoaPods
command: pod install
- save_cache:
key: 1-pods-{{ checksum "Podfile.lock" }}
paths:
- ./Pods
- run:
name: Run Tests
command: bundle exec fastlane $FASTLANE_LANE
- store_artifacts:
path: output
- store_test_results:
path: output/scan
beta:
macos:
xcode: "10.1.0"
working_directory: /Users/distiller/project
environment:
FL_OUTPUT_DIR: output
FASTLANE_LANE: beta
shell: /bin/bash --login -o pipefail
steps:
- checkout
- restore_cache:
key: 1-gems-{{ checksum "Gemfile.lock" }}
- run:
name: Install Gemfile for Fastlane
command: bundle check || bundle install --path vendor/bundle
- save_cache:
key: 1-gems-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- restore_cache:
key: 1-pods-{{ checksum "Podfile.lock" }}
- run:
name: Install CocoaPods
command: pod install
- save_cache:
key: 1-pods-{{ checksum "Podfile.lock" }}
paths:
- ./Pods
- run:
name: Submit to Testflight
command: bundle exec fastlane $FASTLANE_LANE
- store_artifacts:
path: output/MyApp.ipa
workflows:
version: 2.1
build-test-beta:
jobs:
- test:
filters:
branches:
only: master
- beta:
requires:
- test
filters:
branches:
only: master