Unity Cloud Build: Corrupted reffernces. Reimport All Assets possible?

When refferences in scenes or prefabs are missing usually a reimport all fixes all issues, but when those problems occur in a cloud build, that get’s it’s data from a git repository the solution seems much harder. The AssetDatabase API allows for a reimport in a prebuild script:

using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;

class Reimporter : IPreprocessBuildWithReport {

    public int callbackOrder { get { return 0; } }
    public void OnPreprocessBuild(BuildReport report) {
        AssetDatabase.ImportAsset("Assets", ImportAssetOptions.ImportRecursive);
    }
}

But the UnityEditor libary isn’t accessible in a cloud build.
Is there a way to fix missing refferences in a cloud build or trigger a reimport via a pre build script or something similiar?

PS: Local builds after a fresh checkout of the github project do not have this issue, and only Cloud builds suffer from these missing refferences. Maybe someone knows the root of the issue and how to overcome it, so that none of these hacky solutions would be required.