feat: add APP_UPDATE_PAT for GitHub API rate limit bypass#634
Merged
Conversation
- Modify `app/build.gradle.kts` to expose `APP_UPDATE_PAT` through `BuildConfig`. - Update `Updater.kt` and `AboutScreen.kt` to include the `Authorization` header in GitHub API calls when the PAT is available. - Update GitHub Actions workflows (`build.yml`, `release.yml`, `build_pull_request.yml`) to pass the `APP_UPDATE_PAT` secret to the build environment. Signed-off-by: Hà Tiến Sáng <bemimnitran@gmail.com>
a350dd9 to
2752f72
Compare
Member
Author
|
@koiverse I forgot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for using a GitHub Personal Access Token (
APP_UPDATE_PAT) in the app to increase GitHub API rate limits for features like update checking and contributor list fetching.Technical Changes
APP_UPDATE_PATtoapp/build.gradle.kts, reading fromlocal.propertiesor environment variables and exposing it viaBuildConfig.moe.koiverse.archivetune.utils.Updaterto include aBearertoken in theAuthorizationheader for fetching releases and commit history.moe.koiverse.archivetune.ui.screens.settings.AboutScreento include the same header when fetching repository contributors.build.yml,release.yml, andbuild_pull_request.yml) to inject theAPP_UPDATE_PATsecret into the build environment.Fallback
The implementation checks if the token is non-blank before adding the header, ensuring the app falls back to unauthenticated requests if no token is provided during build.