Skip to content

Sharing a token across an org #27178

Answered by bcomnes
et asked this question in Actions
Discussion options

You must be logged in to vote

The way we solved a similar problem was by creating a machine user account, adding it to our org, and then generating a personal access token from that account.  

Then, in actions that need to be able to access other private org repos, we would set that PAT as an action secret. Then inside your action, use that PAT to set up an authorized environment that can access org private repos.

In our case, we were authorizing Terraform, which references modules via https git, so all we needed to do was set up a netrc file prior to accessing other private repos.  This can be done with a simple run action or slightly less verbose action we wrote to do just this:

https://github.com/little-core-labs/n…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants