Refused to connect Getting 404 Error after connecting my GitHub Enterprise using 2nd gen--Cloud Build How to fix this issue

When I tried to connect to Enterprise GitHub repository to Cloud Build using 2nd gen , the Connection flow is working fine till authentication but once i click on add app it is adding the app and it is redirecting to 404 page in GitHub how to fix it

Checked in the GitHub it did added the app. but in cloud build it is enable to connect

Steps to reproduce: cloud build→Repositories→2nd gen→ Create Host Connection →GitHub Enterprise

This we are it is navigating Fyi I removed my org details in the url [https:///github-apps/google-cloud-build/installations/new?state=MCNwcm9qZWN0cy8xNTU4NDUxMjk5MTgvbG9jYXRpb25zL3VzLWNlbnRyYWwxL2Nvbm5lY3Rpb25zL1RRTA%3D%3D]

Hi Sudheer_Reddy_N,

Try to manually inspect and correct the GitHub App’s configuration within your GitHub Enterprise environment by going to your GitHub Enterprise Settings, finding the installed Cloud Build App, and verifying that the User Authorization Callback URL matches the one expected by Cloud Build for your region and connection type. While the exact URL may vary, the format for redirecting back to the Cloud Build Console is crucial for completing the connection. If your GitHub Enterprise instance is hosted in a private network, refer to Build repositories from GitHub Enterprise in a private network to learn about the additional IAM roles required for host connection. Also, ensure that the initial Cloud Build Host Connection was correctly configured for Private Network access using Service Directory, as any network blockage will prevent the final handshake and cause an error. Finally, confirm that both your Google Cloud user and the Cloud Build Service Agent have the required Secret Manager Secret Accessor IAM role, as the 2nd Gen connection process stores its security keys there. Insufficient permissions will prevent the connection from finalizing.

For further guidance, you may refer to this documentation on connecting to a GitHub Enterprise repository, which outlines the setup process, permissions, and troubleshooting tips.

Thank you sharing the workaround around it , i will check it out