File tree Expand file tree Collapse file tree
.github/actions/check-pr-title-format Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 pattern="$PATTERN"
2626 message="$MESSAGE"
2727
28+ escape_workflow_command_value() {
29+ local value="$1"
30+ value="${value//'%'/'%25'}"
31+ value="${value//$'\r'/'%0D'}"
32+ value="${value//$'\n'/'%0A'}"
33+ printf '%s' "$value"
34+ }
35+
36+ escaped_message="$(escape_workflow_command_value "$message")"
37+ escaped_pattern="$(escape_workflow_command_value "$pattern")"
38+
2839 echo "PR title: $title"
2940 echo "Required pattern: $pattern"
3041
@@ -38,10 +49,10 @@ runs:
3849 status=$?
3950 case "$status" in
4051 1)
41- echo "::error::$message "
52+ echo "::error::$escaped_message "
4253 ;;
4354 2)
44- echo "::error::Input 'pattern' is not a valid regular expression: $pattern "
55+ echo "::error::Input 'pattern' is not a valid regular expression: $escaped_pattern "
4556 ;;
4657 *)
4758 echo "::error::Unexpected error while validating PR title"
You can’t perform that action at this time.
0 commit comments