Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

Best way to clone a private repo during script run of private Github Action

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...

1 Reply
Community Manager
Message 2 of 2

Re: Best way to clone a private repo during script run of private Github Action

Hi @agibralter,

 

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.

 

Best

Thanks for being here, sharing, and keeping our community awesome!
Best,
AndreaG

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!