@Override
    public Environment setUpEnvironment(@SuppressWarnings("rawtypes") AbstractBuild build, Launcher launcher, BuildListener listener) {
        Map<String, String> envVars = returnEnvironmentVars(build, listener);
        if (envVars != null) {
            LOGGER.log(Level.FINE, "Job: " + build.getFullDisplayName() + " Attempting to send GitHub commit status");

            try {
                returnGhprbSimpleStatus(envVars).onEnvironmentSetup(build, listener, repo);
            } catch (GhprbCommitStatusException e) {
                e.printStackTrace();
            }
        }

        return new Environment() {
        };
    }
@ Override public Environment setUpEnvironment ( @ SuppressWarnings ( "rawtypes" ) AbstractBuild build , Launcher launcher , BuildListener listener ) { Map < String , String > envVars = returnEnvironmentVars ( build , listener ) ; if ( envVars != null ) { LOGGER . log ( Level . FINE , "Job: " + build . getFullDisplayName ( ) + " Attempting to send GitHub commit status" ) ; try { returnGhprbSimpleStatus ( envVars ) . onEnvironmentSetup ( build , listener , repo ) ; } catch ( GhprbCommitStatusException e ) { e . printStackTrace ( ) ; } } return new Environment ( ) { } ; }
Sets the status as pending when the job starts and then calls the createCommitStatus method to send it to GitHub