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:
- In the upper-right corner of any GitHub page, click your profile photo and select Settings.
- Navigate to Developer settings.
- Click Personal access tokens, then select Tokens (fine-grained tokens).
- Click Generate new token.
- Provide a token name description. Set the Resource owner and Repository access fields accordingly.
- Under Permissions, change the workflow scope to Read and write access. Set additional permissions accordingly.
- Click Generate token.
- 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 (AWS | Azure | GCP) documentation.