I am writing a GitHub action within a private repo (./github-actions/my-action/entrypoint.sh). For reasons I need to clone a different private repo from with my org during the docker container's run of that script:
git clone "https://$GITHUB_TOKEN@github.com/myorg/other-private-repo.git" /other-private-repo
This does not work as the token the action is running with does not have access to that repo. I guess I could create a "machine" account, provide access to other-private-repo, and use that account's token as a secret. I'm just wondering if there is a more elegant way here...
Thanks for being here! I can't think of any obvious way to significantly improve your method. Will keep digging and post any updates here.
Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!
@agibralter im trying to do the same, did you find any good solution for this you could share with the world :)
We went with the "machine account" method. Created a user with its own set of credentials that we added as GitHub Action secrets.