Hi Julien Carsique, no need to provide a Stack Trace in my case.
I explained the problem in my previous comment, in our case the problem is caused by the version 4.0.x of the Jenkins git-plugin.
It seems that your Exception is thown at the same place than our, in our case at line L78] the method returns an empty list.
As a result at L82] the buildData returned is null and then at L87] an IOException is thrown.
The problem in our case is that the git-plugin does not create BuildData objects since version 4.0.x, instead it creates instances of class BuildDetails. So using build.getActions(BuildData.class) does not work, I used build.getActions(BuildDetails.class) instead at L78] and adapted the code in consequence to fix the problem.
I think you can try to debug the problem as I did. What your can do is to update the Github Plugin by adding a logger and logging the class names of the actions you'll receive when calling https://javadoc.jenkins-ci.org/hudson/model/Actionable.html#getActions-- at the beginning of the getCommitSHA1 function.
Their are chances you have an Action describing your build which is not of same class as the BuildData class and that's why its not working as expected.
Let me know if you tried to fix the problem and what is the class name of your action in your case.
Hope this helps