diff --git a/internal/directives/git_pr_waiter.go b/internal/directives/git_pr_waiter.go index 7bb54923f..d4a340d65 100644 --- a/internal/directives/git_pr_waiter.go +++ b/internal/directives/git_pr_waiter.go @@ -131,28 +131,28 @@ func (g *gitPRWaiter) runPromotionStep( } func getPRNumber(sharedState State, cfg GitWaitForPRConfig) (int64, error) { - if cfg.PRNumberFromOpen == "" { + if cfg.PRNumberFromStep == "" { return cfg.PRNumber, nil } - stepOutput, exists := sharedState.Get(cfg.PRNumberFromOpen) + stepOutput, exists := sharedState.Get(cfg.PRNumberFromStep) if !exists { return 0, fmt.Errorf( "no output found from step with alias %q", - cfg.PRNumberFromOpen, + cfg.PRNumberFromStep, ) } stepOutputMap, ok := stepOutput.(map[string]any) if !ok { return 0, fmt.Errorf( "output from step with alias %q is not a map[string]any", - cfg.PRNumberFromOpen, + cfg.PRNumberFromStep, ) } prNumberAny, exists := stepOutputMap[prNumberKey] if !exists { return 0, fmt.Errorf( "no PR number found in output from step with alias %q", - cfg.PRNumberFromOpen, + cfg.PRNumberFromStep, ) } // If the state was rehydrated from PromotionStatus, which makes use of @@ -166,7 +166,7 @@ func getPRNumber(sharedState State, cfg GitWaitForPRConfig) (int64, error) { default: return 0, fmt.Errorf( "PR number in output from step with alias %q is not an int64", - cfg.PRNumberFromOpen, + cfg.PRNumberFromStep, ) } } diff --git a/internal/directives/git_pr_waiter_test.go b/internal/directives/git_pr_waiter_test.go index e51e04207..1a3b83517 100644 --- a/internal/directives/git_pr_waiter_test.go +++ b/internal/directives/git_pr_waiter_test.go @@ -36,17 +36,17 @@ func Test_gitPRWaiter_validate(t *testing.T) { }, }, { - name: "neither prNumber nor prNumberFromOpen specified", + name: "neither prNumber nor PRNumberFromStep specified", config: Config{}, expectedProblems: []string{ "(root): Must validate one and only one schema", }, }, { - name: "both prNumber and prNumberFromOpen specified", + name: "both prNumber and PRNumberFromStep specified", config: Config{ "prNumber": 42, - "prNumberFromOpen": "fake-step", + "PRNumberFromStep": "fake-step", }, expectedProblems: []string{ "(root): Must validate one and only one schema",