tag:help.appveyor.com,2012-11-13:/discussions/problems/26244-secure-token-showing-in-appveyor-logAppVeyor: Discussion 2020-02-11T19:15:25Ztag:help.appveyor.com,2012-11-13:Comment/480790622020-02-11T00:22:36Z2020-02-11T00:22:36ZSecure token showing in appveyor log<div><p>Hi Taj,</p>
<p>Yes, you can configure the token in credentials store, like in this PowerShell snippet:</p>
<pre>
<code>- ps: |
git config --global credential.helper store
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:GH_PAT):x-oauth-basic@github.com`n"</code>
</pre>
<p>where <code>GH_PAT</code> is environment variable with your personal access token, marked as "secure".</p>
<p>If you decide to re-work that example for batch files pay attention to the string with credentials ending with just <code>LF</code> (`<code>n</code>), not <code>CRLF</code>.</p>
<p>Let me know how that worked.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/480790622020-02-11T14:29:42Z2020-02-11T14:29:43ZSecure token showing in appveyor log<div><p>Thanks for the response Feodor,<br>
What should the .git-credentials file contain in this case?</p>
<pre>
<code>"https://$(<gh-token>):x-oauth-basic@github.mycompany.com`n"</code>
</pre>
<p>I've set this up locally and I'm still prompted for credentials when I try to clone</p></div>Taj Santiagotag:help.appveyor.com,2012-11-13:Comment/480790622020-02-11T16:23:59Z2020-02-11T16:23:59ZSecure token showing in appveyor log<div><p>Thanks for the response Feodor,<br>
What should the .git-credentials file contain in this case?</p>
<pre>
<code>"https://$(<github-token>):x-oauth-basic@github.<my-company>.com`n"</code>
</pre>
<p>I've set this up locally and I'm still prompted for credentials when I try to clone</p></div>Taj Santiagotag:help.appveyor.com,2012-11-13:Comment/480790622020-02-11T18:00:00Z2020-02-11T18:00:01ZSecure token showing in appveyor log<div><p>I think this worked, thank you Feodor!</p></div>Taj Santiagotag:help.appveyor.com,2012-11-13:Comment/480790622020-02-11T18:36:52Z2020-02-11T18:36:53ZSecure token showing in appveyor log<div><p>I did run into another issue. I am trying to clone a repo holding shared credentials and I get</p>
<pre>
<code>APPVEYOR_PULL_REQUEST_NUMBER is null, cloning credentials.
git : Cloning into 'C:\projects\sdk-credentials'...
At line:4 char:3
+ git clone https://$env:CREDENTIALS_GITHUB_TOKEN@github.comopany.com/ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Cloning into 'C...credentials'...:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError</code>
</pre>
<p>Any advice here?</p></div>Taj Santiagotag:help.appveyor.com,2012-11-13:Comment/480790622020-02-11T18:41:40Z2020-02-11T18:41:40ZSecure token showing in appveyor log<div><p>Could you send your <code>appveyor.yml</code> please?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/480790622020-02-11T18:58:37Z2020-02-11T18:58:37ZSecure token showing in appveyor log<div><p>Here is the version I am working on<br>
<a href="https://github.com/watson-developer-cloud/dotnet-standard-sdk/blob/7996-february-2020-release/appveyor.yml">https://github.com/watson-developer-cloud/dotnet-standard-sdk/blob/...</a></p>
<p>The main issue I was trying to solve is the error at the end of this build</p>
<p><a href="https://ci.appveyor.com/project/mediumTaj/dotnet-standard-sdk/builds/30239153">https://ci.appveyor.com/project/mediumTaj/dotnet-standard-sdk/build...</a></p>
<p>Running semantic release results in a failed build. I thought I should move this from powershell to cmd to address the failure.</p></div>Taj Santiagotag:help.appveyor.com,2012-11-13:Comment/480790622020-02-11T19:02:03Z2020-02-11T19:02:03ZSecure token showing in appveyor log<div><p>Yes, switching to "cmd" will do the trick. These "RemoteException" errors happen when a tool writes something to StdErr which is treated by PowerShell as exception.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/480790622020-02-11T19:02:34Z2020-02-11T19:02:34ZSecure token showing in appveyor log<div><p>With <code>git clone</code> adding <code>-q</code> (quiet) arg could work as well.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/480790622020-02-11T19:15:23Z2020-02-11T19:15:25ZSecure token showing in appveyor log<div><p>Thanks Feodor, I'll try adding <code>-q</code> to both the git clone and the npx call that was giving me the issue!</p></div>Taj Santiago