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?

GitHub のリポジトリが最後に更新された日付を取得する

Posted at

背景

GitHub で管理しているリポジトリのバックアップを日次で取得する際、更新されたリポジトリのみを対象にできると効率的になる。
git clone する前に最終更新日時を取得したい

結論

リポジトリ一覧取得 API のレスポンスから pushed_at を参照する
リモートブランチの作成、コミットの push などで pushed_at が更新される
似た項目で updated_at が存在するが更新されなかった(何に対するupdate?)

対象API

https://docs.github.com/ja/rest/repos/repos?apiVersion=2022-11-28#list-organization-repositories
https://docs.github.com/ja/rest/repos/repos?apiVersion=2022-11-28#get-a-repository

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?