You should be able to push by using a specific user and its own personal token, from inside the script:
git push https://<User Name>:<Token>@github.com/<User Name>/<Your Repository>.git
https://stackoverflow.com/a/72591028/67397
Topic:
Developer Tools & Services
SubTopic:
Xcode Cloud
Tags: