0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Jenkins】GitHubリポジトリのScan Repository Nowに時間がかかる

Last updated at Posted at 2024-10-19

GitHubリポジトリのリポジトリスキャンに時間がかかる

GitHubリポジトリに対してScan Repository Nowを実行すると以下ログが表示されてスキャンが終わらない問題に遭遇した。
ログ内容としてはGitHubAPIのレート制限に引っかかっているかららしい

15:55:22 Connecting to https://api.github.com with no credentials, anonymous access
15:55:23 Jenkins-Imposed API Limiter: Current quota for Github API usage has 52 remaining (1 over budget). Next quota of 60 in 59 分. Sleeping for 5 分 12 秒.
15:55:23 Jenkins is attempting to evenly distribute GitHub API requests. To configure a different rate limiting strategy, such as having Jenkins restrict GitHub API requests only when near or above the GitHub rate limit, go to "GitHub API usage" under "Configure System" in the Jenkins settings.
15:58:24 Jenkins-Imposed API Limiter: Still sleeping, now only 2 分 10 秒 remaining.
16:00:36 Jenkins-Imposed API Limiter: Current quota for Github API usage has 49 remaining (1 over budget). Next quota of 60 in 54 分. Sleeping for 4 分 36 秒.
16:00:36 Jenkins is attempting to evenly distribute GitHub API requests. To configure a different rate limiting strategy, such as having Jenkins restrict GitHub API requests only when near or above the GitHub rate limit, go to "GitHub API usage" under "Configure System" in the Jenkins settings.

解決方法

JenkinsにGitHubのPersonal access tokensを登録して、GitHubの認証を通す。

  1. GitHubのPersonal access tokensを作成する
  2. 作成したPersonal access tokensをJenkinsに認証情報を登録する。
    • 登録画面の場所
      ダッシュボード→Jenkinsの管理→認証情報→(global)→Add Credentials
    • 以下情報を登録画面に入力する。
    • 種類 ユーザー名とパスワード
    • ユーザー名 GitHubのユーザー名
    • パスワード 作成したPersonal access tokens
    • ID 登録情報を識別できる好きな名前にする。
  3. ジョブに認証情報を使うように設定する。
    • 設定画面の場所
      ダッシュボード→My-Pipeline→Configuration

Credentials項目で認証情報を登録したGitHubのユーザー名を選択する(例: username/*****)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?