Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

503 B
Raw Blame
#!/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"