Skip to content

Commit

Permalink
👷 misc(CI): fix links in tag description
Browse files Browse the repository at this point in the history
I don't think it's possible to override the preprocessors using an env variable.
  • Loading branch information
welpo committed Feb 4, 2024
1 parent 1382b44 commit 7cc74d1
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions release
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 7cc74d1

Please sign in to comment.