[PR #23] [MERGED] Add GitHub API authentication to avoid rate limit errors #25

Closed
opened 2026-02-27 19:08:54 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CaddyBuilds/caddy-cloudflare/pull/23
Author: @r4y7s
Created: 10/16/2025
Status: Merged
Merged: 12/7/2025
Merged by: @vkartk

Base: mainHead: feature/github-rate-limit


📝 Commits (3)

  • 096967f Update check_caddy_status.py
  • c571158 Update check-caddy-release.yml
  • 44edc92 Update check_caddy_status.py

📊 Changes

2 files changed (+9 additions, -7 deletions)

View changed files

📝 .github/workflows/check-caddy-release.yml (+1 -0)
📝 scripts/check_caddy_status.py (+8 -7)

📄 Description

Problem

The script makes unauthenticated requests to the GitHub API, which causes 403 rate limit errors when running frequently in CI/CD:

HTTP Error fetching latest GitHub release: 403 403 Client Error: rate limit exceeded

Example: https://github.com/CaddyBuilds/caddy-cloudflare/actions/runs/18362086185

Unauthenticated requests are limited to 60/hour, while authenticated requests get 5,000/hour.

Solution

Added support for the GITHUB_TOKEN environment variable to authenticate requests. The script falls back gracefully to unauthenticated requests if the token is not provided.

Usage

In GitHub Actions workflows:

The GITHUB_TOKEN is automatically provided by GitHub Actions and requires no additional configuration.

Changes

  • Read GITHUB_TOKEN from environment
  • Add Authorization header when token is available
  • Add logging to indicate authentication status

This is fully backward compatible and eliminates rate limit issues.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CaddyBuilds/caddy-cloudflare/pull/23 **Author:** [@r4y7s](https://github.com/r4y7s) **Created:** 10/16/2025 **Status:** ✅ Merged **Merged:** 12/7/2025 **Merged by:** [@vkartk](https://github.com/vkartk) **Base:** `main` ← **Head:** `feature/github-rate-limit` --- ### 📝 Commits (3) - [`096967f`](https://github.com/CaddyBuilds/caddy-cloudflare/commit/096967f55de5ea7fce84b225a2926a48442141b6) Update check_caddy_status.py - [`c571158`](https://github.com/CaddyBuilds/caddy-cloudflare/commit/c571158bac091755cc6665167a5728f98f4d1048) Update check-caddy-release.yml - [`44edc92`](https://github.com/CaddyBuilds/caddy-cloudflare/commit/44edc92805b9194bf8de15dde78f29dce0c9f6c7) Update check_caddy_status.py ### 📊 Changes **2 files changed** (+9 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/check-caddy-release.yml` (+1 -0) 📝 `scripts/check_caddy_status.py` (+8 -7) </details> ### 📄 Description ## Problem The script makes unauthenticated requests to the GitHub API, which causes 403 rate limit errors when running frequently in CI/CD: ``` HTTP Error fetching latest GitHub release: 403 403 Client Error: rate limit exceeded ``` Example: https://github.com/CaddyBuilds/caddy-cloudflare/actions/runs/18362086185 Unauthenticated requests are limited to 60/hour, while authenticated requests get 5,000/hour. ## Solution Added support for the `GITHUB_TOKEN` environment variable to authenticate requests. The script falls back gracefully to unauthenticated requests if the token is not provided. ## Usage In GitHub Actions workflows: The `GITHUB_TOKEN` is automatically provided by GitHub Actions and requires no additional configuration. ## Changes - Read `GITHUB_TOKEN` from environment - Add `Authorization` header when token is available - Add logging to indicate authentication status This is fully backward compatible and eliminates rate limit issues. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 19:08:54 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/caddy-cloudflare#25
No description provided.