#!/bin/sh
# Git credential helper that reads GITHUB_TOKEN from the environment.
# Configured via git config --system credential.helper.
if [ "$1" = "get" ]; then
  if [ -n "$GITHUB_TOKEN" ]; then
    echo "protocol=https"
    echo "host=github.com"
    echo "username=x-access-token"
    echo "password=$GITHUB_TOKEN"
  fi
fi
