MCPcopy Create free account
hub / github.com/github/gh-aw / buildExperimentArtifactDownloadSteps

Function buildExperimentArtifactDownloadSteps

pkg/workflow/compiler_experiments.go:566–576  ·  view source on GitHub ↗

buildExperimentArtifactDownloadSteps creates a download step for the experiment artifact. The artifact is downloaded to experimentsCacheDir so the detection agent can read the current variant assignments from state.json. The step is a no-op when no experiments are declared. pinAction resolves the do

(data *WorkflowData, pinAction func(string) string)

Source from the content-addressed store, hash-verified

564// The step is a no-op when no experiments are declared.
565// pinAction resolves the download-artifact action reference; pass c.getActionPin from Compiler methods.
566func buildExperimentArtifactDownloadSteps(data *WorkflowData, pinAction func(string) string) []string {
567 if len(data.Experiments) == 0 {
568 return nil
569 }
570 artifactName := experimentArtifactDownloadName(data)
571 return buildArtifactDownloadSteps(ArtifactDownloadConfig{
572 ArtifactName: artifactName,
573 DownloadPath: experimentsCacheDir + "/",
574 StepName: "Download experiment artifact",
575 }, pinAction)
576}
577
578// buildPushExperimentsStateJob creates a job that downloads the experiment-state artifact and
579// commits it to a git branch ("experiments/{sanitizedID}") for durable storage across runs.

Calls 2