Accessing images from README.md of Private Repos #23385
-
My team has a private GitHub repository and has an internal wiki via GraphQL. When accessing the images while not logged in, it does indeed show 404 Error. Is it possible to access the image without having the need to login? Or this is strictly forbidden since it’s a private repository? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
inanperillo:
The latter, since all contents are private. If you want to make part of the docs and images visible publicly you’ll have to come up with an automated solution to export them somewhere else, e.g. a public repository, a website, etc. You can easily achieve this via some script, which you can then exploit via some CI service or GitHub Actions to ensure that whenever the master branch of you repository is updated all the public assets are update too (you can use Git commands in the script to detect changed files). |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply. This is what I thought of too. We don’t need all repos in enterprise-private, only a selected few anyways. So I know this can be done. I guess, what I’m asking here, and I can’t find info about it, is: Can i pass PAT in the URL as an html content for the readme? I was able to do curl commands using [email protected] in CLI but in my testing have failed to use this as an html content (as part of the readme). Not that I need this in the solution, but now, more of: I’m interested to know. |
Beta Was this translation helpful? Give feedback.
-
inanperillo:
I’m not sure of this, for it might require some redirection steps after validation, which are only possible to handle if you have full control over a server. Maybe this page is of help, or at least provides a good introduction and useful external links:
LinkConfigure Link to connect to institutions via OAuth, which redirects users to their bank's site to log in. OAuth is required for European institutions. Whether it’s doable or not, I don’t think that including your username and authentication token inside a link within a public document is a good idea, for it would compromise the security of that account. Also, this might violate GitHub EULA, since you’re expected to do your best to protect all your secret keys and access tokens. |
Beta Was this translation helpful? Give feedback.
-
That makes sense. With the absence of documentation about it and with the points you raised, I’d assume this is indeed not possible. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Okay, what I have done here is create a new repo that would be used for sharing public assets |
Beta Was this translation helpful? Give feedback.
The latter, since all contents are private. If you want to make part of the docs and images visible publicly you’ll have to come up with an automated solution to export them somewhere else, e.g. a public repository, a website, etc.
You can easily achieve this via some script, which you can then exploit via some CI service or GitHub Actions to ensure that whenever the master branch of you repository is updated all the public assets are update too (you can use Git commands in the script to detect changed files).