Self hosting without using GitHub Personal Access Token #8790
-
Hi Is using PATs mandatory to use shields with private github repos? If so, why also use a github app config? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hello. The To access private repos from a self-hosted install, you will need to use a PAT. If you want to constrain the scope of that token as much as possible, I think you should be able to generate a fine-grained PAT which has read-only access to a subset of repos, although I have not tested it with a fine-grained PAT myself and I have not enumerated exactly which repo permissions would be needed for each badge. Assuming you do go down that route, it would be great if you could post any learnings from that here as we have not updated the self-hosting docs since fine-grained PATs were introduced a few months back. |
Beta Was this translation helpful? Give feedback.
Hello. The
GH_CLIENT_ID
andGH_CLIENT_SECRET
settings are only used by shields.io for configuring our GitHub OAuth app ( https://img.shields.io/github-auth ) which allows users to donate a token (with read-only access to public repos) and increase our rate limit. These settings are not generally used for self-hosted installs. See the docs athttps://github.com/badges/shields/blob/a0149a8f8f9f2be4f8286a6e267e12aab9d1e8ab/doc/server-secrets.md?plain=1#L143-L148C50
To access private repos from a self-hosted install, you will need to use a PAT. If you want to constrain the scope of that token as much as possible, I think you should be able to generate a fine-grained PAT which has read-only ac…