MCPcopy
hub / github.com/docker/build-push-action / buildRef

Function buildRef

src/main.ts:241–258  ·  view source on GitHub ↗
(toolkit: Toolkit, since: Date, builder?: string)

Source from the content-addressed store, hash-verified

239);
240
241async function buildRef(toolkit: Toolkit, since: Date, builder?: string): Promise<string> {
242 // get ref from metadata file
243 const ref = toolkit.buildxBuild.resolveRef();
244 if (ref) {
245 return ref;
246 }
247 // otherwise, look for the very first build ref since the build has started
248 if (!builder) {
249 const currentBuilder = await toolkit.builder.inspect();
250 builder = currentBuilder.name;
251 }
252 const refs = Buildx.refs({
253 dir: Buildx.refsDir,
254 builderName: builder,
255 since: since
256 });
257 return Object.keys(refs).length > 0 ? Object.keys(refs)[0] : '';
258}
259
260function buildChecksAnnotationsEnabled(): boolean {
261 if (process.env.DOCKER_BUILD_CHECKS_ANNOTATIONS) {

Callers 1

main.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected