Navigation Menu

Skip to content

How is the GitHub token injected into git? #25255

Answered by jsoref
gaborcsardi asked this question in Actions
Discussion options

You must be logged in to vote

No it isn’t done w/ the git credential store, it’s done w/ the .git/config file:

  <a href="https://github.com/actions/checkout/blob/ec3a7ce113134d7a93b817d10a8272cb61118579/src/git-auth-helper.ts#L55-L65" target="_blank" rel="noopener">github.com</a>

actions/checkout/blob/ec3a7ce113134d7a93b817d10a8272cb61118579/src/git-auth-helper.ts#L55-L65

<pre class="onebox">      <code class="lang-ts">
    <ol class="start lines" start="55" style="counter-reset: li-counter 54 ;">
        <li>this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader` // "origin" is SCHEME://HOSTNAME[:PORT]</li>
        <li>const basicCredential = Buffer.from(</li>
        <li>  `x-access-token:${this.settings.aut…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants