I am trying to implement the following step in my gitlab CI pipeline and running into syntax errors: unexpected end of file
my-ci-step: image: 676020893150.dkr.ecr.us-east-1.amazonaws.com/rust:nightly-20201001 stage: check allow_failure: false dependencies: - install - build script: - export PATH=$PATH:.cargo/bin - > if [ "$CI_COMMIT_REF_NAME" == "/^staging\/.*/"]; then echo "Skipping version check for staging branch" else RUST_LOG=info [run some shell command] fi
I don’t think using rules would work for me since I want to run different scripts based on the branch rather than decide when to run the step or not. Are there suggestions on how to fix/ other ways to do this? Thanks!
For reference, I first looked at this post: if statement - How to use if-else condition on gitlabci - Stack Overflow