Files
codex-security/docker/git-credential.sh
T
ianw-oai 10e7a22461 chore(codex-security): sync public projection
- [codex-security] prevent untrusted pre-commit hook execut...
  (And 4 more changes)

GitOrigin-Timestamp=2026-07-27T10:45:08-07:00
GitOrigin-RevId: 23c8e48a18db9283b3fc1335bf40ea63402400c6
2026-07-27 18:00:36 +00:00

32 lines
503 B
Bash

#!/bin/sh
set -eu
if [ "${1:-}" != get ]; then
exit 0
fi
protocol=
host=
while IFS= read -r line; do
case "$line" in
protocol=*) protocol=${line#protocol=} ;;
host=*) host=${line#host=} ;;
"") break ;;
esac
done
if [ "$protocol" != https ] \
|| [ "$host" != "${CODEX_SECURITY_GIT_HOST:-github.com}" ]; then
exit 0
fi
token=${GH_TOKEN:-${GITHUB_TOKEN:-}}
if [ -z "$token" ]; then
exit 0
fi
printf '%s\n' 'username=x-access-token' "password=$token"