Skip to content

Commit fff0090

Browse files
authored
Merge branch 'main' into twishabansal-patch-3
2 parents 4f9227e + fa175e2 commit fff0090

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

.github/workflows/markdown-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2828

2929
- name: Link Checker
30-
uses: lycheeverse/lychee-action@885c65f3dc543b57c898c8099f4e08c8afd178a2 # v2.6.1
30+
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2.7.0
3131
with:
3232
# There is no security token. So, it would fail on any links which aren't public.
3333
args: "--verbose --no-progress **/*.md"

.github/workflows/mirror-changelog.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,25 @@ jobs:
8282
// Match and extract changelog item
8383
const itemMatch = trimmedLine.match(/^[*-]\s(.*)$/);
8484
if (itemMatch) {
85-
const originalContent = itemMatch[1];
85+
let originalContent = itemMatch[1];
86+
87+
// This is a two-step process to prevent `release-please` from
88+
// creating mangled, doubly-nested links for PRs.
89+
90+
// STEP 1: CLEAN THE INPUT.
91+
// The source changelog contains a zero-width space as an HTML entity (`​`).
92+
// This breaks the regex in the next step, so we must remove it first.
93+
// E.g., "[#​1770](...)" becomes "[#1770](...)"
94+
originalContent = originalContent.replace(/​/g, '');
95+
96+
// STEP 2: PROTECT THE OUTPUT.
97+
// `release-please` aggressively tries to auto-link any text that looks like `#1234`.
98+
// To prevent this, we insert an invisible Unicode zero-width space (`\u200B`)
99+
// between the '#' and the number in the link text. This breaks the parser's
100+
// pattern matching without changing the visual appearance of the link.
101+
// E.g., "[#1770](...)" becomes "[genai-toolbox#​1770](...)"
102+
originalContent = originalContent.replace(/\[#(\d+)\](\([^)]+\))/g, '[genai-toolbox#\u200B$1]$2');
103+
86104
const lineAsLowerCase = originalContent.toLowerCase();
87105
88106
const hasPrefix = prefixesToFilter.some(prefix => lineAsLowerCase.includes(prefix));

0 commit comments

Comments
 (0)