From dfef1a7b5ab07617d3c5a595f3764bdcc01ef23e Mon Sep 17 00:00:00 2001 From: Jakub Beránek Date: Mon, 10 Mar 2025 13:56:42 +0100 Subject: Handle backticks in try job patterns --- src/ci/citool/src/main.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/ci') diff --git a/src/ci/citool/src/main.rs b/src/ci/citool/src/main.rs index 2a4be061e4e..cd690ebeb06 100644 --- a/src/ci/citool/src/main.rs +++ b/src/ci/citool/src/main.rs @@ -46,13 +46,20 @@ impl GitHubContext { } } - /// Tries to parse patterns of CI jobs that should be executed in the form of + /// Tries to parse patterns of CI jobs that should be executed + /// from the commit message of the passed GitHub context + /// + /// They can be specified in the form of /// try-job: - /// from the commit message of the passed GitHub context. + /// or + /// try-job: `` + /// (to avoid GitHub rendering the glob patterns as Markdown) fn get_try_job_patterns(&self) -> Vec { if let Some(ref msg) = self.commit_message { msg.lines() .filter_map(|line| line.trim().strip_prefix("try-job: ")) + // Strip backticks if present + .map(|l| l.trim_matches('`')) .map(|l| l.trim().to_string()) .collect() } else { -- cgit 1.4.1-3-g733a5