feat: add build logs to stdout forwarding#4339
Open
robertlestak wants to merge 3 commits intoactions:masterfrom
Open
feat: add build logs to stdout forwarding#4339robertlestak wants to merge 3 commits intoactions:masterfrom
robertlestak wants to merge 3 commits intoactions:masterfrom
Conversation
Add optional feature to forward GitHub Actions build logs to pod stdout after job completion, enabling capture through Kubernetes logging solutions. Changes: - Add logForwarding.enabled config option (default: false) - Create forward-logs.sh script to output worker logs with delimiters - Integrate with job-completed hook system - Update all Dockerfile variants to include script - Modify Helm templates to pass FORWARD_BUILD_LOGS env var - Support all container modes (default, dind, kubernetes, kubernetes-novolume) Resolves actions#2478
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds optional functionality to forward GitHub Actions build logs to pod stdout after job completion, enabling integration with Kubernetes logging solutions. The implementation uses the existing hook system and is disabled by default to maintain backward compatibility.
Key Changes:
- Introduces
logForwarding.enabledconfiguration option in Helm values - Creates
forward-logs.shscript to extract and output worker logs from diagnostics directory - Integrates forwarding via job-completed hook system
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| runner/forward-logs.sh | Core script that reads worker logs from diagnostics directory and outputs to stdout when enabled |
| runner/hooks/job-completed.d/forward-logs | Hook entry point that executes the log forwarding script after job completion |
| runner/actions-runner*.dockerfile | Updates COPY directives across all Dockerfile variants to include forward-logs.sh |
| charts/gha-runner-scale-set/values.yaml | Adds logForwarding configuration section with enabled flag defaulting to false |
| charts/gha-runner-scale-set/templates/_helpers.tpl | Injects FORWARD_BUILD_LOGS environment variable into container specs when feature is enabled |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix shell scripting issue with unquoted variables in forward-logs.sh - Add error handling to hook script before executing forward-logs.sh - Use null-terminated while loop to handle filenames with spaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add optional feature to forward GitHub Actions build logs to pod stdout after job completion, enabling capture through Kubernetes logging solutions.
Changes:
Resolves #2478