generateSquidLogsUploadStep creates a GitHub Actions step to upload Squid logs as artifact.
(workflowName string, workflowData *WorkflowData)
| 98 | |
| 99 | // generateSquidLogsUploadStep creates a GitHub Actions step to upload Squid logs as artifact. |
| 100 | func generateSquidLogsUploadStep(workflowName string, workflowData *WorkflowData) GitHubActionStep { |
| 101 | sanitizedName := strings.ToLower(SanitizeWorkflowName(workflowName)) |
| 102 | artifactName := "firewall-logs-" + sanitizedName |
| 103 | // Firewall logs location: /tmp/gh-aw on standard runners, ${{ runner.temp }}/gh-aw on ARC/DinD. |
| 104 | // Use ${{ runner.temp }} (Actions expression) because `with:` blocks don't expand shell vars. |
| 105 | firewallLogsDir := constants.AWFProxyLogsDir + "/" |
| 106 | if isArcDindTopology(workflowData) { |
| 107 | firewallLogsDir = "${{ runner.temp }}/gh-aw/sandbox/firewall/logs/" |
| 108 | } |
| 109 | |
| 110 | stepLines := []string{ |
| 111 | " - name: Upload Firewall Logs", |
| 112 | " if: always()", |
| 113 | " continue-on-error: true", |
| 114 | " uses: " + getActionPin("actions/upload-artifact"), |
| 115 | " with:", |
| 116 | " name: " + artifactName, |
| 117 | " path: " + firewallLogsDir, |
| 118 | " if-no-files-found: ignore", |
| 119 | } |
| 120 | |
| 121 | return GitHubActionStep(stepLines) |
| 122 | } |
| 123 | |
| 124 | // generateFirewallLogParsingStep creates a GitHub Actions step to parse firewall logs and create step summary. |
| 125 | func generateFirewallLogParsingStep(workflowName string, workflowData *WorkflowData) GitHubActionStep { |
no test coverage detected