github-release-attachments datasource fails for private repos when using a GitHub App token #43330
Unanswered
lboynton
asked this question in
Request Help
Replies: 2 comments
|
Hi there, You're reporting a problem with an old version of Renovate. Please try the latest version and tell us if that fixes your problem. Be sure to provide updated logs once you have run with a newer version. Good luck, The Renovate team |
0 replies
|
Hi there, |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
How are you running Renovate?
Self-hosted Renovate CLI
Which platform you running Renovate on?
GitHub.com
Which version of Renovate are you using?
43.179.0
Please tell us more about your question or problem
The github-release-attachments datasource downloads release assets using browser_download_url (e.g. https://github.com/owner/repo/releases/download/tag/file). This is GitHub's browser-facing download URL, which does not accept GitHub App installation tokens for private repositories. It returns 404 even when the token has contents: read permission on the repository.
GitHub API calls to api.github.com (used for listing releases and metadata) work correctly with App tokens. Only the asset download itself fails, because it goes through GitHub's web layer rather than the API.
Steps to reproduce
In lib/modules/datasource/github-release-attachments/index.ts (https://github.com/renovatebot/renovate/blob/main/lib/modules/datasource/github-release-attachments/index.ts), asset content is fetched using:
browser_download_url always resolves to https://github.com/..., the web download URL. For private repos, GitHub App tokens are not accepted here.
Suggested fix
Use the GitHub API asset endpoint instead of browser_download_url:
Logs (if relevant)
Logs
All reactions