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!