Husky
New Contributor III

I use target overrides to switch between branch and tags on different environments:

 

resources:
  jobs:
    my_job:
      git_source:
        git_url: <REPO-URL>
        git_provider: gitHub

targets:
  staging:
    resources:
      jobs:
        my_job:
          git_source:
            # Use Git branch for staging deploys 
            git_branch: ${var.git_branch}

  prod:
    resources:
      jobs:
        my_job:
          git_source:
            # Use Git tag for prod deploys 
            git_tag: ${var.git_tag}

 

 Discussion about that can be found here: https://github.com/databricks/cli/issues/1255

You need to repeat that for every job you define, which can be a pain if you have many jobs.