claude-memory/reference_gitea_auth.md

1.4 KiB
Raw Permalink Blame History

name description type
Gitea リポジトリ自動作成方法 新アプリ作成時にGiteaリポジトリをAIが自動作成する手順手動案内は禁止 reference

Gitea 認証情報の取得方法

GITEA_TOKEN 環境変数は設定されていないが、git credential store に認証情報が保存されている。

GITEA_PASS=$(git credential fill <<< $'protocol=http\nhost=100.76.7.3:3000' | grep password | cut -d= -f2)

Gitea リポジトリ作成コマンド

curl -s -X POST "http://100.76.7.3:3000/api/v1/user/repos" \
    -H "Content-Type: application/json" \
    -u "mai:$GITEA_PASS" \
    -d "{\"name\":\"APP_ID\",\"private\":false,\"auto_init\":false}"
  • エンドポイント: /api/v1/user/reposuser = mai
  • 成功時: {"full_name":"mai/APP_ID",...} が返る
  • 既存の場合: {"message":"The repository with the same name already exists."} → push だけ実行すればよい

必須ルール

新アプリ作成時に「Giteaリポジトリは手動で作成してください」と案内してはいけない。 必ず上記コマンドで自動作成し、git push gitea main まで完了させる。

Why: 以前は手動案内していたが、credential store に認証情報があることを確認済み2026-03-22How to apply: 新アプリのgit init → commit → Gitea作成curl→ GitHub作成gh→ push の順で完結させる。