Skip to content

Commit ba2f2fe

Browse files
committed
Don't use SSH signing on codespaces
1 parent 3b3d004 commit ba2f2fe

File tree

3 files changed

+11
-21
lines changed

3 files changed

+11
-21
lines changed

chezmoi/dot_config/git/config.tmpl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
useConfigOnly = true
1717
name = Colin Seymour
1818
19-
#signingkey = 88109C73073E7080
19+
# signingkey = 88109C73073E7080
20+
# Don't use SSH signing on Codespaces as it doesn't play nicely.
21+
{{- if not .codespaces }}
2022
signingkey = ~/.ssh/git_signing_ed25519.pub
23+
{{- end }}
2124

2225
# Override default when working in work repos
2326
[includeIf "hasconfig:remote.*.url:ssh://[email protected]/github/*"] # Requires git 2.36.0 later
@@ -128,15 +131,17 @@
128131
gpgSign = true
129132

130133
[gpg]
134+
{{- if .codespaces }}
135+
program = /.codespaces/bin/gh-gpgsign
136+
{{- else }}
131137
format = ssh
132-
# {{- if .codespaces }}
133-
# program = /.codespaces/bin/gh-gpgsign
134-
# {{- else }}
135138
# program = {{- lookPath "gpg" }}
136-
# {{- end }}
139+
{{- end }}
137140

141+
{{- if not .codespaces }}
138142
[gpg "ssh"]
139143
allowedSignersFile = ~/.ssh/allowed_signers
144+
{{- end }}
140145

141146
[merge]
142147
conflictstyle = zdiff3

chezmoi/dot_config/zsh/private_dot_zshrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@ if [ -n "$CODESPACES" ]; then
118118
export GOPRIVATE=
119119
export GONOPROXY=
120120
export GONOSUMDB='github.com/github/*'
121-
# Unset these as GitHub doesn't verify commits by the default GitHub <[email protected]> set by default in Codespaces
122-
# This doesn't help things if you use the UI to commit
123-
unset GIT_COMMITTER_EMAIL
124-
unset GIT_COMMITTER_NAME
125121
fi
126122
export HOMEBREW_BUNDLE_FILE=$XDG_CONFIG_HOME/homebrew/Brewfile
127123
export IRBRC=$XDG_CONFIG_HOME/irb/irbrc

script/codespaces-post-start

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,4 @@ fi
1919

2020
if [ ! -f "${HOME}/.netrc" ] || grep -vq "goproxy.githubapp.com" "${HOME}/.netrc"; then
2121
echo "machine goproxy.githubapp.com login nobody password $GITHUB_TOKEN" >> "$HOME/.netrc"
22-
fi
23-
24-
if [ ! -f "${HOME}/.ssh/git_signing_ed25519" ]; then
25-
# Takes this from my Codespaces secrets config on GitHub
26-
echo "$GIT_SIGNING_KEY" > "${HOME}/.ssh/git_signing_ed25519"
27-
unset GIT_SIGNING_KEY
28-
chmod 600 "${HOME}/.ssh/git_signing_ed25519"
29-
fi
30-
31-
# Unset these as GitHub doesn't verify commits by the default GitHub <[email protected]> set by default in Codespaces
32-
unset GIT_COMMITTER_EMAIL
33-
unset GIT_COMMITTER_NAME
22+
fi

0 commit comments

Comments
 (0)