We have an Azure DevOps pipeline which connects to a GitHub project. The pipeline is throwing the following exception: ‘Unable to resolve the reference ‘refs/heads/main”.

Reason and Fix:
- The issue was caused by a policy change at the GitHub level : Reduce or eliminate PAT use.
- We were using a Personal Access Token (PAT) to connect Azure DevOps to GitHub.
- The PAT token was configured with a ‘No Expiry’ setting.
- GitHub updated its policy to restrict access for PAT tokens with a lifetime exceeding 365 days.

- To resolve the issue, we regenerated the PAT token.
- The new PAT token was configured with an expiry of less than 365 days, as required by GitHub’s updated policy.
🙂

![[Step by Step] Beginner : Create a PCF control and add it to a custom page](https://rajeevpentyala.com/wp-content/uploads/2024/12/image-49.png)
![[Step by Step] Using Custom Connectors in Copilot Studio](https://rajeevpentyala.com/wp-content/uploads/2024/10/record-ezgif.com-video-to-gif-converter-7.gif)
Leave a comment