1
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?

CURLやGitHub Actionsで自分のリポジトリの情報が取得できない

Posted at

はじめに

GitHub Acitonsでissuesを操作しようとしたときに、自分のissuesが取得できずに少し詰まったので記事にします。

CURLで取得しようとした

curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer {用意したGITHUB_TOKEN} \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/{あなたのユーザー名}/{対象のリポジトリ名}/issues

公式ページと見比べても書き方は合っているが、404が返ってくる
https://docs.github.com/ja/rest/issues/issues?apiVersion=2022-11-28#list-repository-issues:~:text=COLLABORATOR%22%0A%20%20%7D%0A%5D-,List%20repository%20issues,-List%20issues%20in

解決

用意したGITHUB_TOKENに権限の付与が必要でした。
GithubのSettings > Developer Settingsから、作成しているTOKENにissuesを取得する権限を付与します。
添付画像の最下部から設定できました。
スクリーンショット 2025-08-01 1.26.52.png

最後に

そーだいさんの真似をして日報をissuesで書きたいと思い、今回の記事を書く流れになりました。
https://soudai.hatenablog.com/entry/2023/11/02/215019
毎日自分の行動をふりかえって成長していくって大事ですね。
読んでくださりありがとうございました!

1
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
1
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?