Skip to content

test: add regression test for branch name single-quote escaping in pipeline triggers #179

@jamesadevine

Description

@jamesadevine

Problem

generate_pipeline_resources now wraps branch names in single quotes and escapes embedded ' characters, but test_pipeline_resources_escapes_single_quotes only asserts on source: and project: — the branch escaping path is untested.

A branch value like release/it's-ready should produce - 'release/it''s-ready' but there is no regression test covering this.

Suggested Fix

Add a branch with a single quote to the existing test:

branches: vec!["it's-branch".to_string()],
// assert!(result.contains("- 'it''s-branch'"));

Context

Found during review of #175 (security audit fixes).

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions