Raw File URL Of Private Repository #23845
-
When I click on the Raw file Button on a file on my private Repo, The Download link is of the form
This link works also when I am not logged in, There is a token attached to the URL. I wanted to know if that token is supposed to be kept secret or is it safe to share the link in case I want to share a file from private Repository? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Hi @theabbie o/ I went ahead and re-categorized this post, but if you feel there is an API action that you’re trying to take with this raw URL, then please let me know and we can switch back 🙇 Though for your question:
Yes! There’s really no reason why this would be unsafe to share, AFAIK. When we look at this post:
Hi @shaigluskin, Thank you for being here! The token will expire in 7 days. …we can see:
So you won’t be able to keep that URL permanently, as it will change. Please let us know if this is helpful and if you have any remaining questions or concerns! |
Beta Was this translation helpful? Give feedback.
-
Awesome, Thank you for clarifying my doubt |
Beta Was this translation helpful? Give feedback.
-
How is that token generated? I’m trying to access my gist via the Github API. |
Beta Was this translation helpful? Give feedback.
-
For a gist you shouldn’t need a token, those are available as long as you have the URL. Unless you access so many files that you might get in trouble with rate limiting. 😉 In that case, or to download files from a private repository you’ll need a PAT, see Creating a personal access token. Note that the PAT is not added to the URL, you need to add an
I have a private git repository like: Github.com/acct/repo1 I have a test.json file in another private repository in the same GitHub subscription and account like: Github.com/acct/repo2/test.json How can a workflow in repo1 have http get access to the url Github.com/acct/repo2/test.json ? All I need is a simple way to read the content of test.json in a workflow running on repo2 . It works the best for me to read the file using a curl get request. |
Beta Was this translation helpful? Give feedback.
-
Can I somehow get permament url to the file in private repository? I’m using jenkins with configuration-as-code plugin, and I want it to look at github for configuration file. |
Beta Was this translation helpful? Give feedback.
-
sankouski-dzmitry:
Not using only a URL. The file URL (without the |
Beta Was this translation helpful? Give feedback.
-
Do you know how often the token changes? |
Beta Was this translation helpful? Give feedback.
Hi @theabbie o/
I went ahead and re-categorized this post, but if you feel there is an API action that you’re trying to take with this raw URL, then please let me know and we can switch back 🙇
Though for your question:
Yes! There’s really no reason why this would be unsafe to share, AFAIK. When we look at this post: