buildUploadDetectionLogStep creates the step to upload the detection-artifact. In workflow_call context, the artifact name is prefixed to avoid name clashes when the same reusable workflow is called multiple times within a single workflow run. The prefix comes from the agent job output since the det
(data *WorkflowData)
| 420 | // same reusable workflow is called multiple times within a single workflow run. |
| 421 | // The prefix comes from the agent job output since the detection job depends on the agent job. |
| 422 | func (c *Compiler) buildUploadDetectionLogStep(data *WorkflowData) []string { |
| 423 | detectionArtifactName := artifactPrefixExprForAgentDownstreamJob(data) + constants.DetectionArtifactName |
| 424 | return []string{ |
| 425 | " - name: Upload threat detection log\n", |
| 426 | fmt.Sprintf(" if: %s\n", detectionStepCondition), |
| 427 | fmt.Sprintf(" uses: %s\n", c.getActionPin("actions/upload-artifact")), |
| 428 | " with:\n", |
| 429 | " name: " + detectionArtifactName + "\n", |
| 430 | " path: /tmp/gh-aw/threat-detection/detection.log\n", |
| 431 | " if-no-files-found: ignore\n", |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | // buildInstallThreatDetectStep creates a step that installs the threat-detect binary |
| 436 | // from GitHub Releases at the pinned version. This is used when the gh-aw-detection |