File tree Expand file tree Collapse file tree
.github/actions/pr-review Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6868 exit 1
6969 fi
7070 for reserved in "### Connector PR Review:" "### General PR Review:" "### PR Review:"; do
71- if [[ "${SUMMARY_MARKER}" != "${reserved}" && "${SUMMARY_MARKER}" == "${reserved}"* ]]; then
72- echo "::error::summary_marker must not extend a reserved review heading"
71+ if [[ "${SUMMARY_MARKER}" != "${reserved}" && "${SUMMARY_MARKER}" == * "${reserved}"* ]]; then
72+ echo "::error::summary_marker must not embed a reserved review heading"
7373 exit 1
7474 fi
7575 done
Original file line number Diff line number Diff line change @@ -50,12 +50,12 @@ def is_valid_summary_heading(value: str) -> bool:
5050 return False
5151 if not value .startswith ("### " ) or not value .endswith (":" ):
5252 return False
53- # Prefix -based legacy consumers must not mistake a custom summary for
53+ # Substring -based legacy consumers must not mistake a custom summary for
5454 # their own. Exact built-in headings remain valid for existing callers.
55- if value != LEGACY_REVIEW_SUMMARY_HEADING and value . startswith ( LEGACY_REVIEW_SUMMARY_HEADING ) :
55+ if value != LEGACY_REVIEW_SUMMARY_HEADING and LEGACY_REVIEW_SUMMARY_HEADING in value :
5656 return False
5757 for reserved in BUILT_IN_REVIEW_SUMMARY_HEADINGS :
58- if value != reserved and value . startswith ( reserved ) :
58+ if value != reserved and reserved in value :
5959 return False
6060 return bool (value [len ("### " ):- 1 ].strip ())
6161
Original file line number Diff line number Diff line change @@ -628,11 +628,14 @@ def test_rejects_malformed_headings(self):
628628 with self .subTest (value = value ):
629629 self .assertFalse (fpc .is_valid_summary_heading (value ))
630630
631- def test_rejects_reserved_heading_extensions (self ):
631+ def test_rejects_reserved_heading_collisions (self ):
632632 for value in (
633633 "### Connector PR Review: Replay:" ,
634634 "### General PR Review: Replay:" ,
635635 "### PR Review: Replay:" ,
636+ "### Replay: ### Connector PR Review:" ,
637+ "### Replay: ### General PR Review:" ,
638+ "### Replay: ### PR Review:" ,
636639 ):
637640 with self .subTest (value = value ):
638641 self .assertFalse (fpc .is_valid_summary_heading (value ))
You can’t perform that action at this time.
0 commit comments