Symptoms:
- How do I configure my project to build automatically?
- I've set auto-build on my build target configuration, but the builds are not starting when I update my repository.
Cause:
- Auto-Build is not configured properly on the build target.
- Your repository/Versioning Control System (VCS) permissions are not set correctly for users authenticating via Personal Authorization Token (PAT).
- Your repository/VCS did not properly create the webhook for users authenticating via Personal Authorization Token (PAT).
Resolution:
Auto-build can be configured in the Build Target configuration on the basic settings tab toward the bottom of the panel.
The way Auto-builds are triggered varies depending on your source control settings (DevOps > Build Automation > Settings > Source Control (tab)).
- If your project is set up to use SSH Authentication, changes to your repository are determined periodically by our service polling it. There can be a slight delay with this process, although builds are usually triggered in a reasonable time frame. If you find that your builds are not starting when you update the repository and you are using SSH Authentication, please reach out to the Service Support Team with a ticket for further investigation.
- If your project is set up to use PAT Authentication, Unity Build Automation will attempt to create a webhook at the project level on your VCS to trigger a build automatically when the repository is updated.
The most common issue with the webhook auto-build method is that the webhook was not created correctly. In order for our service to create the webhook, the PAT needs to allow the service to read and write webhooks. The exact permission varies depending on the service, but for Github, for example, this would be the admin_repo_hook permission:
You can try re-creating your PAT with the appropriate permissions and then disabling and re-enabling auto-builds on the Unity Build Automation build configuration to see if the webhook is properly generated. Where you validate this also depends on the VCS you're using but for the most commonly used GitHub, it can be viewed in the repository under Settings > Webhooks (you should see a hook created for https://build-api.cloud.unity3d.com):
If you have validated the presence of the webhook but you find that your builds are not starting, you can try re-generating the webhook. If that fails, please open a ticket with Support for further investigation.
Additional Information:
Unity Build Automation - Build target configuration
UBA Forums - Using PAT for authentication