Skip to content

[Optimization][CI] Init k3s fails with GitHub API 403 #4586

Closed

Description

@aiwenmo

Search before asking

  • I had searched in the issues and found no similar optimization requirement.

Description

The Init k3s step fails before the cluster is created. nolar/setup-k3d-k3s@v1 starts by listing k3s releases:

GET https://api.github.com/repos/k3s-io/k3s/releases?per_page=100&page=1

The workflow does not pass github-token, so the log shows an empty GITHUB_TOKEN and the request is unauthenticated. Unauthenticated calls share a limit of about 60 requests per hour per egress IP. GitHub-hosted runners share those IPs, so the quota is often already used up. GitHub then returns HTTP 403. The action runs curl --fail, which exits with code 22, and retries three times immediately with no backoff. All three attempts hit the same 403, and the step exits in about 0s.

The 403 is returned while listing releases, before the action matches version: v1.35.2+k3s1. The step succeeds when that shared IP still has quota left, so the failure is intermittent.

secrets.GITHUB_TOKEN is injected automatically for each Actions job. It does not need to be created under repository secrets. Passing it raises the limit to about 1,000 requests per hour per repository:

- name: Init k3s
  uses: nolar/setup-k3d-k3s@v1
  with:
    version: v1.35.2+k3s1
    k3d-args: -s 1 --network dinky_net --api-port 172.28.0.1:6550
    k3d-tag: v5.7.5
    github-token: ${{ secrets.GITHUB_TOKEN }}

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions