just create bin/pre_compile file, and add two env variables to heroku GITHUB_USER and GITHUB_AUTH_TOKEN this helped me since using ssh doesn't work for me for some reason
#!/bin/bash
if [ -f "$ENV_DIR/GITHUB_USER" ]; then
GITHUB_USER=$(cat "$ENV_DIR/GITHUB_USER")
fi
if [ -f "$ENV_DIR/GITHUB_AUTH_TOKEN" ]; then
GITHUB_AUTH_TOKEN=$(cat "$ENV_DIR/GITHUB_AUTH_TOKEN")
fi
if [ -z "$GITHUB_USER" ]; then
echo "GITHUB_USER is not set."
exit 1
fi
if [ -z "$GITHUB_AUTH_TOKEN" ]; then
echo "GITHUB_AUTH_TOKEN is not set."
exit 1
fi
sed -i "s#git+ssh://[email protected]/#git+https://$GITHUB_USER:[email protected]/#g" requirements.txt