fix bug 1057012, 1079882

Replaces #2778
nice, I got stuck here when I tried to reverse `github_callback`