Skip to content

Commit

Permalink
fix(linux): gh login
Browse files Browse the repository at this point in the history
  • Loading branch information
senz committed May 2, 2024
1 parent 074cafb commit 1c9d52e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .chezmoi.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{{ $email := "" -}}
{{- $recipient := "" -}}
{{- $fullname := "" -}}
{{- $ghlogin := "" -}}
{{- if stdinIsATTY -}}
{{/* we are in interactive mode */}}
{{- $email = promptStringOnce . "email" "Email address" -}}
{{- $recipient = promptStringOnce . "recipient" "GPG recipient" -}}
{{- $fullname = promptStringOnce . "fullname" "Full name" -}}
{{- $ghlogin = promptStringOnce . "ghlogin" "Github.com login" -}}
{{- else -}}
{{- $email = "[email protected]" -}}
{{- $recipient = "XXX" -}}
{{- $fullname = "User" -}}
{{- $ghlogin = "User" -}}
{{- end -}}

{{ if not ( env "REMOTE_CONTAINERS" | empty ) -}}
Expand All @@ -23,7 +26,7 @@ data:
email: {{ $email | quote }}
recipient: {{ $recipient | quote }}
fullname: {{ $fullname | quote }}

ghlogin: {{ $ghlogin | quote }}
gpg:
recipient: {{ $recipient | quote }}

Expand Down
1 change: 1 addition & 0 deletions dot_gitconfig.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
[credential "https://github.com"]
helper = cache
helper = github # important that you put it last because we only need to run gcg when other helpers have failed to give credentials
username = {{ .ghlogin }}
{{ end -}}
[credential "https://dev.azure.com"]
useHttpPath = true
Expand Down

0 comments on commit 1c9d52e

Please sign in to comment.