When using the GitHubCommitStatusSetter class in a pipeline like so:
The plugin will report:
ERROR: [GitHub Commit Status Setter] - Cannot retrieve Git metadata for the build, setting build result to UNSTABLE
When used in conjunction with the Folders plugin, and the parent folder has a different name than the git repo has.
So for instance, a folder structure like this correctly sets the status:
But one like this will fail:
I believe this is due to the logic here: https://github.com/jenkinsci/github-plugin/blob/1f5b40a8169516b58f4c715373836dba6ff96216/src/main/java/org/jenkinsci/plugins/github/util/BuildDataHelper.java#L55
The logic is checking the parent "build" to see that it matches the checked out project URL. There are perhaps other cases where this logic works, but when using the Folder plugin, it presumably is using the folder as the parent build, so naming your folder something different than what is contained in the git url causes it to find nothing valid.