Github webhook triggers jenkins job with too large JSON payload error

I’m working on a continuous integration setup for a project. All code is on a github repo which then gets merged will trigger a webhook to a jenkins server where a specific job is run. From there this job looks at the payload and determines what downstream job to run based on its branch. The rest of the payload is not needed. In the instance where there are a lot of commits in the merge the json payload will be very large, so much that it will break with the following error:

Cloning the remote Git repository
Cloning repository <git_repo>
> git init <http://jenkins_instance/job> # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not init <http://jenkins_instance/job>
Caused by: hudson.plugins.git.GitException: Error performing command: git init <http://jenkins_instance/job>
Caused by: Cannot run program "git" (in directory "<http://jenkins_instance/job>")>: error=7, Argument list too long
Caused by: error=7, Argument list too long
ERROR: null

Is there a way to reduce this payload size? Or a suggestion on how to handle the payload to avoid the error?

Setup is similar to this post How to process a github webhook payload in Jenkins?

Current setup for this job is “Parameterized” and has one parameter “String paramter” for the “payload”. This variable is then saved into a file like so during the main shell execution:

echo "Current payload is ${payload}"
if [ -d ./payload.txt ]
    rm payload.txt;
touch payload.txt
echo $payload >> payload.txt

Git Baby is a git and github fan, let's start git clone.