How can a Github workflow read a file on another private repository hosted on the same GitHub account? #27201
-
I have a private git repository like:
I have a
How can a workflow in All I need is a simple way to read the content of It works the best for me to read the file using a curl get request. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
You can use a Personal Access Token (PAT) with the
|
Beta Was this translation helpful? Give feedback.
-
Thank you so much for help. Any suggestion for learning path where do I learn details like this? |
Beta Was this translation helpful? Give feedback.
-
You’re welcome! 😺 Nothing too specific, I’m afraid. The key here is knowing that PATs can be used to authorize all sorts of things. I then just checked the documentation on scopes to see which would be needed, and tried downloading a file from a private repository to make sure it’d actually work. I picked up most of the general concepts by poking around the documentation and reading here on the forum. 😉 |
Beta Was this translation helpful? Give feedback.
You can use a Personal Access Token (PAT) with the
repo
scope to authorize the request to theraw.githubusercontent.com
URL for the file. If you add the PAT as a secret for your repository, you can do something like this: