Symptoms:
- I am seeing the error message: "Error fetching branches" when trying to create a new build target in Unity Build Automation.
- I'm having issues connecting my repository/Versioning Control System (VCS) to Unity Build Automation (UBA).
- Unity Build Automation (UBA) is failing to clone the repository.
Cause:
-
Insufficient Permissions for Personal Access Token (PAT):
- The PAT used lacks the necessary permissions to interact with the repository.
-
User Role Restrictions:
- While users may belong to an organization, only Managers or Owners can access UBA functionalities. If the user is categorized as an organization User, they must be assigned to the specific project to enable access.
Resolution:
1. Verify Project Access for Users
- Ensure users have access to the desired project in Unity Build Automation by following the steps outlined in the article: Users in my organization are not able to access Build Automation functionality.
2. Recreate and Reauthenticate Your Personal Access Token (PAT)
-
Go to your Version Control System (VCS) and create a new PAT with the following permissions:
-
repo
: Full control of private repositories. -
admin:repo_hook
: Full control of repository hooks.
-
-
Reauthorize the PAT in Unity DevOps:
- Navigate to Build Automation Settings > Source Control.
- Add the new PAT to reauthenticate.
3. Verify Webhook Creation in VCS
- Check if the webhook has been created in your repository:
- For GitHub: Go to your GitHub repository Settings > Webhooks.
- If the webhook is missing, repeat the PAT reauthorization process in Unity DevOps.
4. Consider Alternative Repository Connection Methods
- Connect your repository using the manual setup method via Git SSH Key. For more information, see the Build Automation Documentation.
More information:
GitHub Managing your personal access tokens