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

com.salesforce.dockerfileimageupdate.repository.GitHub Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 1.1.26
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy