com.salesforce.dockerfileimageupdate.repository.GitHub Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dockerfile-image-update Show documentation
Show all versions of dockerfile-image-update Show documentation
This tool provides a mechanism to make security updates to docker images at scale.
The tool searches github for declared docker images and sends pull requests to projects that are not using
the desired version of the requested docker image.
package com.salesforce.dockerfileimageupdate.repository;
import com.google.common.collect.Multimap;
import org.kohsuke.github.GHRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class GitHub {
private static final Logger log = LoggerFactory.getLogger(GitHub.class);
/**
* Check to see if we found Dockerfiles that need processing in the provided repository and that it isn't archived
*
* @param pathToDockerfilesInParentRepo map of dockerfile repos to process
* @param parent repository to check
* @return is the parent in the list, valid, and not archived?
*/
public static boolean shouldNotProcessDockerfilesInRepo(Multimap pathToDockerfilesInParentRepo, GHRepository parent) {
if (parent == null || !pathToDockerfilesInParentRepo.containsKey(parent.getFullName()) || parent.isArchived()) {
if (parent != null && parent.isArchived()) {
log.info("Skipping archived repo: {}", parent.getFullName());
}
return true;
}
return false;
}
}