From 66db519d3707e606e5849e521b58dec0197093e4 Mon Sep 17 00:00:00 2001 From: y-yagi Date: Wed, 6 Mar 2024 15:04:26 +0900 Subject: [PATCH] fix(circleci): correctly get a Orb name when a line has an inline comment (#27736) --- lib/modules/manager/circleci/__fixtures__/config2.yml | 4 ++-- lib/modules/manager/circleci/extract.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/modules/manager/circleci/__fixtures__/config2.yml b/lib/modules/manager/circleci/__fixtures__/config2.yml index cf55b2aebc4d87..3f885f3e5c0a15 100644 --- a/lib/modules/manager/circleci/__fixtures__/config2.yml +++ b/lib/modules/manager/circleci/__fixtures__/config2.yml @@ -5,11 +5,11 @@ orbs: release-workflows: hutson/library-release-workflows@4.1.0 # Comments help me understand my work. # The next line is intentionally just whitespace! - + no-version: abc/def # Comments help me understand my work. - volatile: zzz/zzz@volatile + volatile: zzz/zzz@volatile # Comments help me understand my work. test_plan: &test_plan steps: diff --git a/lib/modules/manager/circleci/extract.ts b/lib/modules/manager/circleci/extract.ts index fe1e6adf445e22..9d971de87724c0 100644 --- a/lib/modules/manager/circleci/extract.ts +++ b/lib/modules/manager/circleci/extract.ts @@ -29,7 +29,9 @@ export function extractPackageFile( lineNumber += 1; continue; } - const orbMatch = regEx(/^\s+([^:]+):\s(.+)$/).exec(orbLine); + const orbMatch = regEx(/^\s+([^:]+):\s(.+?)(?:\s*#.*)?$/).exec( + orbLine, + ); if (orbMatch) { logger.trace('orbMatch'); foundOrbOrNoop = true;