Skip to content

Commit

Permalink
fix: prevent GitHub at mentions in quoted release notes
Browse files Browse the repository at this point in the history
Replace instances of @... to [at]... to prevent GitHub from mentioning users that contributed fixes of automated extension updates

Closes #679
  • Loading branch information
rjaegers committed Jan 6, 2025
1 parent 2270b53 commit a144c9a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}
Expand Down Expand Up @@ -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<details>\n<summary>Release notes</summary>\n<blockquote>\n\n%s\n</blockquote>\n</details>\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
Expand Down

0 comments on commit a144c9a

Please sign in to comment.