👷 misc(CI): fix links in tag description

I don't think it's possible to override the preprocessors using an env variable.
main
welpo 1 year ago
parent 1382b44c18
commit 7cc74d1fd9
No known key found for this signature in database
GPG Key ID: A2F978CF4EC1F5A6

@ -92,20 +92,12 @@ export GIT_CLIFF__CHANGELOG__BODY=$(cat <<'EOF'
EOF
)
# Same as cliff.toml, except we don't replace issue number with a link (which aren't clickable on tag descriptions).
export GIT_CLIFF__GIT__PREPROCESSORS=$(cat <<'EOF'
# Remove trailing whitespace.
{ pattern = ' +$', replace = "" },
# Replace multiple spaces with a single space.
{ pattern = ' +', replace = " " },
# Remove gitmoji, both actual UTF emoji and :emoji:
{ pattern = ' *(:\w+:|[\p{Emoji_Presentation}\p{Extended_Pictographic}\u{200D}]) *', replace = "" }
EOF
)
# Generate the tag description.
changelog=$(git cliff --tag "$VERSION_TAG" --unreleased --strip all)
# Undo the pre_processing that adds PR links.
changelog=$(echo "$changelog" | sed -E 's/\[\#([0-9]+)\]\(https:\/\/github\.com\/welpo\/[^\/]+\/issues\/([0-9]+)\)/#\1/g')
# Create a signed and annotated tag.
git tag -s -a "$VERSION_TAG" -m "Release $VERSION_TAG" -m "$changelog"

Loading…
Cancel
Save