Skip to content

Commit d0deb62

Browse files
authored
fix(ci): strip @mentions from dependabot major version analysis comments (#220)
## Summary - Strip `@username` mentions from upstream release notes before posting as PR comments - Prevents notification spam to external open-source contributors - Preserves `@scope/pkg`, `email@domain`, and `action@version` patterns Closes #216 ## Test plan - [x] Regex tested against real spam comment from aimock PR #214 (44 mentions stripped, 0 collateral damage) - [x] YAML code refs (`checkout@v5`) preserved - [x] npm scopes (`@actions/cache`) preserved - [x] Email patterns preserved
2 parents cdc7d19 + 379f748 commit d0deb62

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/dependabot-major-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
breakingChanges = `_Unable to determine breaking changes automatically. Please review the [full changelog](https://github.com/${repoSlug}/releases)._`;
6464
} else {
6565
for (const release of relevantReleases.slice(0, 10)) {
66-
const body = release.body || '_No release notes._';
66+
const body = (release.body || '_No release notes._').replace(/(?<=^|\s)@(?=[a-zA-Z0-9])(?![a-zA-Z0-9-]*\/)/gm, '');
6767
releaseNotesSummary += `### ${release.tag_name}${release.name && release.name !== release.tag_name ? ' — ' + release.name : ''}\n\n`;
6868
releaseNotesSummary += body.substring(0, 2000);
6969
if (body.length > 2000) releaseNotesSummary += '\n\n_...truncated_';

0 commit comments

Comments
 (0)