Skip to content

Conversation

r4y7s
Copy link
Contributor

@r4y7s r4y7s commented Oct 16, 2025

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.

r4y7s added 3 commits October 16, 2025 09:17
Using authenticated GitHub API request
Using authenticated GitHub API request
Using authenticated GitHub API request
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.

1 participant