Skip to content

fix(github): add User-Agent header#644

Merged
pi0 merged 4 commits intounjs:mainfrom
alexandre-hallaine:main
Jul 14, 2025
Merged

fix(github): add User-Agent header#644
pi0 merged 4 commits intounjs:mainfrom
alexandre-hallaine:main

Conversation

@alexandre-hallaine
Copy link
Contributor

This fixes a 403 Forbidden error when using the GitHub driver in Cloudflare Workers or similar serverless environments. GitHub's API requires a User-Agent header, which is missing in these environments by default.

This resolves issue #643.

@alexandre-hallaine alexandre-hallaine requested a review from pi0 as a code owner July 8, 2025 12:23
@alexandre-hallaine
Copy link
Contributor Author

This code is tested

@43081j
Copy link
Member

43081j commented Jul 12, 2025

makes sense 👍

we can't really write a test for this without mocking out the underlying fetch call, so maybe will just have to do with manual testing for now

@pi0 pi0 changed the title fix(driver/github): add User-Agent header for Cloudflare Workers to avoid 403 fix(github): add User-Agent header Jul 13, 2025
@codecov
Copy link

codecov bot commented Jul 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.41%. Comparing base (70310f9) to head (66a02c3).
Report is 28 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #644      +/-   ##
==========================================
+ Coverage   59.99%   61.41%   +1.41%     
==========================================
  Files          42       42              
  Lines        3657     3794     +137     
  Branches      590      632      +42     
==========================================
+ Hits         2194     2330     +136     
- Misses       1460     1461       +1     
  Partials        3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pi0 pi0 merged commit 5c320b7 into unjs:main Jul 14, 2025
4 checks passed
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.

3 participants

Comments