All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.dangernoodle.grt.ext.statuschecks.RepositoryStatusCheckProvider Maven / Gradle / Ivy

package io.dangernoodle.grt.ext.statuschecks;

import java.util.Collection;
import java.util.Collections;
import java.util.Optional;

import io.dangernoodle.grt.Repository;


/**
 * Default status check factory.
 * 

* Returns the contexts field from the protections section of the repository definition for * the given branch. *

* * @since 0.1.0 */ public class RepositoryStatusCheckProvider implements StatusCheckProvider { @Override public Collection getRequiredStatusChecks(String branch, Repository repository) { return Optional.ofNullable(repository.getSettings() .getBranches() .getProtection(branch) .getRequiredChecks() .getContexts()) .orElse(Collections.emptyList()); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy