com.exasol.projectkeeper.github.OutputPublisherFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of project-keeper-core Show documentation
Show all versions of project-keeper-core Show documentation
Project keeper is a tool that verifies and fixes project setups.
The newest version!
package com.exasol.projectkeeper.github;
import java.nio.file.Path;
import java.util.Map;
import java.util.Optional;
/**
* This factory creates new {@link WorkflowOutput}. If environment variable {@code GITHUB_OUTPUT} is present, the
* created publisher will append to the referenced file. If the environment variable is not present, the publisher won't
* publish anything.
*/
class OutputPublisherFactory {
private final Map environment;
OutputPublisherFactory(final Map environment) {
this.environment = environment;
}
WorkflowOutput create() {
return Optional.ofNullable(environment.get("GITHUB_OUTPUT")) //
.map(Path::of) //
.map(FileContentProvider::create) //
.orElseGet(NullContentProvider::new);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy