Compare commits

..
2 Commits
Author SHA1 Message Date
SethCohen 60a5c60e64 chore(master): release 1.15.2 (#35) 2024-10-17 21:16:41 -04:00
Doug Richar 925765f099 fix: improve @mention parsing for GitHub usernames (#33)
- Update regex to correctly identify valid GitHub usernames
- Prevent false positives for package names and email addresses
- Exclude matches within code snippets, URLs, and Markdown links
2024-10-17 21:08:36 -04:00
4 changed files with 16 additions and 6 deletions
+7
View File
@@ -1,5 +1,12 @@
# Changelog # Changelog
## [1.15.2](https://github.com/SethCohen/github-releases-to-discord/compare/v1.15.1...v1.15.2) (2024-10-18)
### Bug Fixes
* improve [@mention](https://github.com/mention) parsing for GitHub usernames ([#33](https://github.com/SethCohen/github-releases-to-discord/issues/33)) ([925765f](https://github.com/SethCohen/github-releases-to-discord/commit/925765f099dcdc3b12316eaa6dc3c17506734b51))
## [1.15.1](https://github.com/SethCohen/github-releases-to-discord/compare/v1.15.0...v1.15.1) (2024-10-04) ## [1.15.1](https://github.com/SethCohen/github-releases-to-discord/compare/v1.15.0...v1.15.1) (2024-10-04)
+6 -3
View File
@@ -28,11 +28,14 @@ const reduceNewlines = (text) => text.replace(/\n\s*\n/g, (ws) => {
}); });
/** /**
* Converts @mentions to GitHub profile links. * Converts @mentions to GitHub profile links for valid GitHub usernames.
* @param {string} text The input text. * @param {string} text The input text.
* @returns {string} The text with @mentions converted to links. * @returns {string} The text with valid @mentions converted to links.
*/ */
const convertMentionsToLinks = (text) => text.replace(/@(\S+)/g, (match, name) => `[@${name}](https://github.com/${name})`); const convertMentionsToLinks = (text) => text.replace(
/(?<![/@\w])@((?!-)(?!.*?--)[a-zA-Z0-9](?:-?[a-zA-Z0-9]){0,37})(?![.\w/-])(?!.*\])/g,
(match, name) => `[@${name}](https://github.com/${name})`
);
/** /**
* Reduces headings to a smaller format if 'reduce_headings' is enabled. * Reduces headings to a smaller format if 'reduce_headings' is enabled.
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "github-releases-to-discord", "name": "github-releases-to-discord",
"version": "1.15.1", "version": "1.15.2",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "github-releases-to-discord", "name": "github-releases-to-discord",
"version": "1.15.1", "version": "1.15.2",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.10.1", "@actions/core": "^1.10.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "github-releases-to-discord", "name": "github-releases-to-discord",
"version": "1.15.1", "version": "1.15.2",
"description": "A GitHub Action that automatically sends a stylized Discord webhook of a GitHub Release description to a specified Discord channel.", "description": "A GitHub Action that automatically sends a stylized Discord webhook of a GitHub Release description to a specified Discord channel.",
"type": "module", "type": "module",
"main": "index.js", "main": "index.js",