Closed4

Bundler のドキュメントをちょっと直したい

snakasnaka

と思ったが、元の記述でも可能らしいことが確認できたので変更不要かもしれない

export BUNDLE_GITHUB__COM=abcd0123generatedtoken:x-oauth-basic

この形式を踏襲して git コマンドの username として PAT を password として x-oauth-basic をそれぞれ入力してみた

$ git clone https://github.com/snaka/rubocop-rails-omakase.git
Cloning into 'rubocop-rails-omakase'...
Username for 'https://github.com': github_pat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Password for 'https://github_pat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@github.com':
remote: Enumerating objects: 60, done.
remote: Counting objects: 100% (60/60), done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 60 (delta 20), reused 60 (delta 20), pack-reused 0 (from 0)
Receiving objects: 100% (60/60), 21.90 KiB | 7.30 MiB/s, done.
Resolving deltas: 100% (20/20), done.

普通に認証通った

snakasnaka

GitHub のドキュメントには x-oauth-basicx-access-token に関する詳しい記述が見当たらない?

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#using-a-personal-access-token-on-the-command-line

Stackoverflow にも記事があるが、正しい情報がよくわからない...

https://stackoverflow.com/questions/42148841/github-clone-with-oauth-access-token

GitHub Apps の認証に関する情報として記述されているが、これと同じと考えて良いのかな... ?

https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation

You can also use an installation access token to authenticate for HTTP-based Git access. Your app must have the "Contents" repository permission. You can then use the installation access token as the HTTP password. Replace TOKEN with the installation access token: git clone https://x-access-token:TOKEN@github.com/owner/repo.git.

このスクラップは2025/01/02にクローズされました