I’m caching my whole git repo and my clone step fails if a branch was forced push, since it can’t be merged.
I figure I can do a fallback Git Clone step with merging disabled for that use case, but I can’t figure out how to only run my second clone step if the first one, which is skippable (so it won’t fail the build), gets skipped.
Here’s my current flow, which is not working:
workflows:
_clone_with_lfs:
steps:
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- cache-pull@2: {}
- git-clone@6.1:
is_skippable: true
inputs:
- reset_repository: 'Yes'
is_always_run: true
- git-clone@6.1:
run_if: ".IsBuildFailed" # is there a flag for checking if the previous step was skipped?
inputs:
- merge_pr: 'no'
- reset_repository: 'Yes'
title: Git Clone - fallback
is_always_run: true
- cache-push@2:
run_if: true
inputs:
- cache_paths: "$BITRISE_SOURCE_DIR"