From a144c9a1226c49d695e7b70c943c2e01498163c2 Mon Sep 17 00:00:00 2001 From: Ron <45816308+rjaegers@users.noreply.github.com> Date: Mon, 6 Jan 2025 11:54:32 +0000 Subject: [PATCH] fix: prevent GitHub at mentions in quoted release notes Replace instances of @... to [at]... to prevent GitHub from mentioning users that contributed fixes of automated extension updates Closes #679 --- .../update-vscode-extensions/update-vscode-extensions.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/update-vscode-extensions/update-vscode-extensions.sh b/.github/actions/update-vscode-extensions/update-vscode-extensions.sh index bba0bd37..6e235cf4 100755 --- a/.github/actions/update-vscode-extensions/update-vscode-extensions.sh +++ b/.github/actions/update-vscode-extensions/update-vscode-extensions.sh @@ -14,6 +14,10 @@ prevent_github_backlinks() { sed 's|https://github.com|https://www.github.com|g' } +prevent_github_at_mentions() { + sed 's| @| [at]|g' +} + get_github_releasenotes() { local GITHUB_URL=${1:?} local CURRENT_RELEASE=${2:?} @@ -43,7 +47,7 @@ for EXTENSION in $(echo $JSON | jq -r '.customizations.vscode.extensions | flatt then GITHUB_URL=$(echo $LATEST_NON_PRERELEASE_VERSION_JSON | jq -r '.properties | map(select(.key == "Microsoft.VisualStudio.Services.Links.GitHub"))[] | .value') - RELEASE_DETAILS=$(get_github_releasenotes $GITHUB_URL $CURRENT_VERSION | prevent_github_backlinks) + RELEASE_DETAILS=$(get_github_releasenotes $GITHUB_URL $CURRENT_VERSION | prevent_github_backlinks | prevent_github_at_mentions) UPDATE_DETAILS_MARKDOWN=$(printf "Updates \`%s\` from %s to %s\n
\nRelease notes\n
\n\n%s\n
\n
\n\n%s" $NAME $CURRENT_VERSION $LATEST_NON_PRERELEASE_VERSION "$RELEASE_DETAILS" "$UPDATE_DETAILS_MARKDOWN") UPDATED_EXTENSIONS_JSON=$(echo $UPDATED_EXTENSIONS_JSON | jq -c '. += ["'$NAME'"]') fi