Skip to content

feat: add APP_UPDATE_PAT for GitHub API rate limit bypass#634

Merged
rukamori merged 1 commit into
ArchiveTuneApp:devfrom
sang765:env/app-update-pat
May 20, 2026
Merged

feat: add APP_UPDATE_PAT for GitHub API rate limit bypass#634
rukamori merged 1 commit into
ArchiveTuneApp:devfrom
sang765:env/app-update-pat

Conversation

@sang765

@sang765 sang765 commented May 19, 2026

Copy link
Copy Markdown
Member

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

  • Build Configuration: Added APP_UPDATE_PAT to app/build.gradle.kts, reading from local.properties or environment variables and exposing it via BuildConfig.
  • API Authentication:
    • Updated moe.koiverse.archivetune.utils.Updater to include a Bearer token in the Authorization header for fetching releases and commit history.
    • Updated moe.koiverse.archivetune.ui.screens.settings.AboutScreen to include the same header when fetching repository contributors.
  • CI/CD: Modified GitHub Actions workflows (build.yml, release.yml, and build_pull_request.yml) to inject the APP_UPDATE_PAT secret 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.

- 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>
@rukamori rukamori force-pushed the env/app-update-pat branch from a350dd9 to 2752f72 Compare May 20, 2026 00:19
@rukamori rukamori merged commit b2551ef into ArchiveTuneApp:dev May 20, 2026
1 check passed
@sang765 sang765 deleted the env/app-update-pat branch May 20, 2026 00:43
@sang765

sang765 commented May 20, 2026

Copy link
Copy Markdown
Member Author

@koiverse I forgot.
PATs in Android apps are completely decompilable, so create restricted PATs with read-only permissions for Contents and Metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants