feat!: Refactor actions variables to pass request by value#4346
Open
stevehipwell wants to merge 6 commits into
Open
feat!: Refactor actions variables to pass request by value#4346stevehipwell wants to merge 6 commits into
stevehipwell wants to merge 6 commits into
Conversation
Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4346 +/- ##
=======================================
Coverage 97.50% 97.51%
=======================================
Files 193 193
Lines 19481 19519 +38
=======================================
+ Hits 18995 19033 +38
Misses 269 269
Partials 217 217 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gmlewis
approved these changes
Jul 1, 2026
gmlewis
left a comment
Collaborator
There was a problem hiding this comment.
Thank you, @stevehipwell!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
alexandear
reviewed
Jul 1, 2026
| func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { | ||
| if variable == nil { | ||
| return nil, errors.New("variable must be provided") | ||
| func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org, name string, body OrgActionsVariableRequest) (*Response, error) { |
Contributor
Contributor
Author
There was a problem hiding this comment.
Good spot, I'll change this.
alexandear
reviewed
Jul 1, 2026
| url := fmt.Sprintf("repos/%v/%v/environments/%v/variables/%v", owner, repo, env, variable.Name) | ||
| return s.patchVariable(ctx, url, variable) | ||
| } | ||
| func (s *ActionsService) UpdateEnvVariable(ctx context.Context, owner, repo, env, name string, body ActionsVariableRequest) (*Response, error) { |
Contributor
There was a problem hiding this comment.
We can't share the same ActionsVariableRequest for create and update. Should be a struct with optional fields.
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.

BREAKING CHANGE:
ActionsServicemethods involving variables have new params and return values.This PR updates the actions variable create & update functions to use a value parameter (see #3644). This aligns actions variables with the changes made to actions secrets in #4335.