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?

Gitの草を自動的に生やすスクリプトが、トークン有効期限切れでFailしたので再度トークンを再生成して復旧させてみた

Last updated at Posted at 2025-07-25

スクリプトがfailしてる

以下のメールが届くようになった 内容は「以前作ったGitに草を生やすのを自動化するスクリプトがfailしている」というものだった(不用意にメールを開く前にGithub上のエラーを確認して照合した)

設定した期間が終了すると自動で止まる認識だったから放置していたが、何日もメールが来るので内容を精査して、復旧させてみることとした

image.png

メールをさかのぼると以下のメールが届いていた

メールの内容
Hi @TKWebSE,

We noticed your personal access token (classic) "daily-commit-token" with repo scope will expire in about 11 hours.

If this token is still needed, visit https://github.com/settings/tokens/hoge/regenerate to generate an equivalent.

If you run into problems, please contact support by visiting https://github.com/contact

Thanks,
The GitHub Team
翻訳
[GitHub] 個人用アクセストークン(クラシック)の有効期限が近づいています

2025/07/20 日曜日 06:39
@TKWebSE 様

リポジトリスコープが設定された個人用アクセストークン(クラシック)「daily-commit-token」が、約11時間後に有効期限切れとなることを確認いたしました。

このトークンがまだ必要な場合は、https://github.com/settings/tokens/hoge/regenerate にアクセスして、同等のトークンを生成してください。

問題が発生した場合は、https://github.com/contact にアクセスしてサポートにお問い合わせください。

よろしくお願いいたします。
GitHub チーム

fail通知メールが届く原因は「個人用アクセストークン(クラシック)「daily-commit-token」が、約11時間後に有効期限切れとなる」らしいということが分かった

Githubを確認する

確かに、failしているようだ

image.png

image.png

エラー解消

原因はわかってるので、それを解消していく
具体的には個人用アクセストークンを生成したら解決するみたいなので、やっていく

まずメールに貼ってあったリンクを踏むと以下のページに飛んだ

image.png

とりあえず、30daysでそのままトークンを再生成してみる

Edit personal access token (classic)画面に遷移した。画面にトークンが表示されたのでそれをコピーして、UpdateTokenを押下した

その後、設定画面のActions secret sand variables画面に移動して、RepositorysecrestsにGH_TOKENがあるので、先ほどコピーしたトークンをそこに入力して保存。

image.png

その後、スクリプトを再度Actionsから動かしてみると無事に動きました!

image.png

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?