Unable to push GitHub Actions workflows from a Databricks repository

Use a Github PAT token with workflow scope.

Written by ismael.khalique

Last published at: May 23rd, 2025

Problem

While attempting to push a GitHub Actions workflow file to your repository's .github/workflows/ folder using a Git folder within your Databricks environment, you encounter the following error.

Error pushing changes: Remote ref update was rejected. Make sure you have write access to this remote repository.

 

This issue is specific to GitHub Actions workflow files and does not affect other types of files.

 

Cause

You're using the Databricks GitHub App to connect to your remote repository. While this method supports standard Git operations, it does not have permission to modify GitHub Actions workflow files in the .github/workflows/ directory. 

 

Solution

To push changes to workflow files, you'll need to use a Github Personal Access Token (PAT) with repo and workflow scopes for a repository using GitHub Actions. (Integration with GitHub Action workflows only supports PAT, not OAuth.)

Steps to generate and configure a Github PAT:

  1. In the upper-right corner of any GitHub page, click your profile photo and select Settings.
     
  2. Navigate to Developer settings.
     
  3. Click Personal access tokens, then select Tokens (fine-grained tokens).
     
  4. Click Generate new token.
     
  5. Provide a token name description. Set the Resource owner and Repository access fields accordingly.
     
  6. Under Permissions, change the workflow scope to Read and write access. Set additional permissions accordingly.
     
  7. Click Generate token.
     
  8. Copy the Github token and enter it in your Databricks workspace by navigating to User Settings > Linked Accounts > Git Integration > Personal access token.

 

For more information, review the Configure Git credentials & connect a remote repo to Databricks (AWSAzureGCP) documentation.