Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/changeset.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/craft.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/mergefest.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/poem-bot.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/smoke-claude.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/smoke-update-cross-repo-pr.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/tidy.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pkg/workflow/push_to_pull_request_branch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@ This workflow has minimal push-to-pull-request-branch configuration.
if !strings.Contains(lockContentStr, "contains(needs.agent.outputs.output_types, 'push_to_pull_request_branch')") {
t.Errorf("Generated workflow should have safe output type condition")
}

// Verify that the default max is 1 (not 0) when not explicitly set
if !strings.Contains(lockContentStr, `"push_to_pull_request_branch":{"max":1}`) &&
!strings.Contains(lockContentStr, `"push_to_pull_request_branch": {"max": 1}`) {
t.Errorf("Expected push_to_pull_request_branch default max to be 1, got content: %s", lockContentStr)
}
Comment on lines +309 to +313
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion is brittle because it depends on an exact JSON snippet (including the nested object ending with }), so it will fail if additional fields are later added to push_to_pull_request_branch config (e.g., target) or if formatting changes. Consider extracting the emitted config.json from the lock file and json.Unmarshal it, then assert config["push_to_pull_request_branch"].max == 1 regardless of other fields.

Copilot uses AI. Check for mistakes.
}

func TestPushToPullRequestBranchWithIfNoChangesError(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflow/safe_outputs_config_generation.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func generateSafeOutputsConfig(data *WorkflowData) string {
if data.SafeOutputs.PushToPullRequestBranch != nil {
safeOutputsConfig["push_to_pull_request_branch"] = generateMaxWithTargetConfig(
data.SafeOutputs.PushToPullRequestBranch.Max,
0, // default: unlimited
1, // default max: 1
data.SafeOutputs.PushToPullRequestBranch.Target,
)
}
Expand Down
Loading