refactor: migrate resource_github_actions_environment_variable to tflog#3325
Open
texasich wants to merge 2 commits intointegrations:mainfrom
Open
refactor: migrate resource_github_actions_environment_variable to tflog#3325texasich wants to merge 2 commits intointegrations:mainfrom
texasich wants to merge 2 commits intointegrations:mainfrom
Conversation
Replace Go standard `log` package with HashiCorp structured `tflog` for consistent logging across the provider. Changes: - Replace `log` import with `fmt` and add `tflog` import - Convert `log.Printf` to `tflog.Info` with structured fields Part of integrations#3070
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
deiga
requested changes
Apr 9, 2026
| if errors.As(err, &ghErr) { | ||
| if ghErr.Response.StatusCode == http.StatusNotFound { | ||
| log.Printf("[INFO] Removing actions variable %s from state because it no longer exists in GitHub", d.Id()) | ||
| tflog.Info(ctx, fmt.Sprintf("Removing actions variable %s from state because it no longer exists in GitHub", d.Id()), map[string]any{ |
Collaborator
There was a problem hiding this comment.
Please don't use fmt.Sprintf inside tflog calls
Address review feedback: use static log message string instead of fmt.Sprintf inside tflog.Info. Remove now-unused "fmt" import.
Author
This was referenced Apr 11, 2026
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.
Replace Go standard
logpackage with HashiCorp structuredtflogfor consistent logging across the provider.Changes:
logimport withfmtand addtflogimportlog.Printftotflog.Infowith structured fieldsResolves [MAINT] Tracking issue for refactoring logging to use
tfloginstead oflog#3070 (partial — this PR covers one file)Before the change?
resource_github_actions_environment_variable.gouses Go's standardlog.Printffor logging, which produces unstructured output inconsistent with the rest of the provider.After the change?
Logging uses HashiCorp's
tflog.Infowith structured key-value fields (variable_id), consistent with the pattern established in other migrated files likeresource_github_membership.go.Pull request checklist