If you use SSH to access the GitHub remote instead of HTTPS you can authenticate with SSH keys. Generate a password-less SSH key as www-data, then add the generated public key in GitHub settings.
See: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#platform-linux and https://help.github.com/articles/reviewing-your-ssh-keys/