-
Notifications
You must be signed in to change notification settings - Fork 6
fix: only enable debug logs GH action is debugged #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: only enable debug logs GH action is debugged #118
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modifies the GitHub Actions logger to only enable debug logs when GitHub Actions debugging is explicitly enabled, improving performance by avoiding unnecessary debug log processing.
- Adds dynamic log level detection based on GitHub Actions environment variables
- Refactors
GithubActionLoggerfrom a unit struct to a struct with configurable log level - Updates logger instantiation to use the new constructor
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/run/run_environment/github_actions/provider.rs |
Updates logger instantiation to use new constructor |
src/run/run_environment/github_actions/logger.rs |
Implements dynamic log level configuration based on environment variables |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
66a856b to
171e73e
Compare
| impl GithubActionLogger { | ||
| pub fn new() -> Self { | ||
| // Only enable debug logging if it's enabled in GitHub Actions. | ||
| let log_level = if env::var("RUNNER_DEBUG").unwrap_or_default() == "1" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have docs on this RUNNER_DEBUG flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's mentioned in the docs here: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#runner-context, i'll add a link in the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks. Actually this page is about the env variables: https://docs.github.com/en/actions/reference/workflows-and-actions/variables
171e73e to
06a03e0
Compare
06a03e0 to
682663e
Compare
682663e to
f7f23f0
Compare
No description provided.