Skip to content

Conversation

@z-Fng
Copy link
Member

@z-Fng z-Fng commented Oct 31, 2025

Motivation and Context

A patch for #6416. When retrieve hash from GitHub API, the token was not included in the request header.

Changes

  • fix(autoupdate): Ensure GitHub API requests use token.
  • refactor(autoupdate): Use a unified function interface to retrieve web content and cache the results.
    Edit: To keep things moving, I've split this change into another PR. This ensures the core updates stay small and get merged quickly, while the optimizations are handled in separate PR.

Related Issues/PRs:

How Has This Been Tested?

Tested on my own computer.

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed GitHub API authentication for autoupdates. Requests to GitHub now properly include authorization credentials and API version headers, improving reliability, increasing available rate limits, and ensuring compatibility with current GitHub API standards.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Oct 31, 2025

Walkthrough

Added conditional GitHub authentication to the autoupdate JSON-hash extraction: when a GitHub API URL is used and a token is present, the code now attaches an Authorization header and sets X-GitHub-Api-Version; changelog updated with the bug-fix entry.

Changes

Cohort / File(s) Summary
Changelog & Script
CHANGELOG.md, lib/autoupdate.ps1
Inserted a bug-fix entry in CHANGELOG.md. In lib/autoupdate.ps1, find_hash_in_json now conditionally adds an Authorization: token ... header and X-GitHub-Api-Version when requesting api.github.com.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A tiny token snug and bright,
Hops with headers through the night,
It whispers "auth" to GitHub's gate,
Ensuring hashes find their fate,
Autoupdate hums — all set and right. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately summarizes the main change: adding token authentication to GitHub API requests in autoupdate functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 52a035b and 4531320.

📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • lib/autoupdate.ps1 (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-31T01:48:00.222Z
Learnt from: z-Fng
Repo: ScoopInstaller/Scoop PR: 6471
File: CHANGELOG.md:9-9
Timestamp: 2025-08-31T01:48:00.222Z
Learning: The Scoop project's CHANGELOG.md follows a convention of tracking PR numbers only, not issue numbers, according to the maintainer z-Fng.

Applied to files:

  • CHANGELOG.md
🔇 Additional comments (1)
CHANGELOG.md (1)

14-14: LGTM! Changelog entry is correct.

The entry properly documents the bug fix with the correct PR reference and follows the project's convention of tracking PR numbers only.

@z-Fng z-Fng marked this pull request as draft October 31, 2025 23:52
@z-Fng z-Fng changed the title fix(autoupdate): Add missing API token to request header in GitHub mode fix(autoupdate): Ensure GitHub API requests use token Nov 3, 2025
@z-Fng z-Fng force-pushed the fix-github-mode branch 5 times, most recently from 4069bc7 to fe10b52 Compare November 11, 2025 18:10
@z-Fng z-Fng marked this pull request as ready for review January 1, 2026 19:56
@niheaven niheaven merged commit bd2e93d into ScoopInstaller:develop Jan 6, 2026
3 checks passed
@z-Fng z-Fng deleted the fix-github-mode branch January 6, 2026 08:11
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