cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Using the Databricks Repos API to bring Repo in top-level production folder to latest version

george2020
New Contributor II

I am having an issue with Github Actions workflow using the Databricks Repos API. We want the API call in the Git Action to bring the Repo in our Databricks Repos Top-level folder to the latest version on a merge into the main branch.

The Github Actions workflow that we have set up is:

on:
  pull_request:
    types:
      - closed
 
jobs:
  if_merged:
    if: github.event.pull_request.merged == true
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: |
          export DATABRICKS_TOKEN=databricks_token_here
          curl PATCH --header "Authorization: Bearer $DATABRICKS_TOKEN" \
          https://<databricks-instance>/api/2.0/repos/{repo_id}?branch=main

Upon merging, the Github Action is successful. But when going back to the Repo in Databricks, the updated files are not there unless we pull in the Databricks Repos UI.

Is there something that I am missing from the Actions workflow?

0 REPLIES 0

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group