Skip to content

Commit

Permalink
🔧 misc(release): add author link only on full changelog
Browse files Browse the repository at this point in the history
Makes it easier to auto-release with `cd.yml`, as release descriptions
automatically link to GitHub profiles based on the handle.
  • Loading branch information
welpo committed Feb 19, 2024
1 parent 46ad1f0 commit 8de049a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ We use Semantic Versioning (SemVer) for our version numbers, formatted as MAJOR.
- *(git-sumi)* Improve emoji matching ([e373482](https://github.com/welpo/tabi/commit/e3734829460d4f93643e7d8fc4a33670f5bb9c6e)) by [@welpo](https://github.com/welpo)
- *(link_checker)* Skip vultr.com links ([0158097](https://github.com/welpo/tabi/commit/0158097594f1d19653f2b68c4fedf802342aa8ad)) by [@welpo](https://github.com/welpo)
- *(projects)* Load git-sumi demo from its repo ([7b13798](https://github.com/welpo/tabi/commit/7b13798a68110d1da63870ea95230ece84526a8b)) by [@welpo](https://github.com/welpo)
- *(release)* Remove link comparison ([e2358f7](https://github.com/welpo/tabi/commit/e2358f7edfc2944e34bc59cbe4b1cbff64412f21))
- *(release)* Remove link comparison ([e2358f7](https://github.com/welpo/tabi/commit/e2358f7edfc2944e34bc59cbe4b1cbff64412f21)) by [@welpo](https://github.com/welpo)
- *(release)* Update CHANGELOG format ([5b5d1fa](https://github.com/welpo/tabi/commit/5b5d1fa592b72b50e1fccf172d9245a9e087bfd3)) by [@welpo](https://github.com/welpo)
- Add renovate config ([3672a94](https://github.com/welpo/tabi/commit/3672a94e863a44e88b1ec0e1896ac6ef38833ef7)) by [@welpo](https://github.com/welpo)

Expand Down
2 changes: 1 addition & 1 deletion cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ footer = """
"""
# postprocessors
postprocessors = [
{ pattern = " @([a-zA-Z0-9](?:[a-zA-Z0-9]+-?)*[a-zA-Z0-9])", replace = " [@$1](https://github.com/$1)"}, # add link to GitHub usernames
# { pattern = " @([a-zA-Z0-9](?:[a-zA-Z0-9]+-?)*[a-zA-Z0-9])", replace = " [@$1](https://github.com/$1)"}, # add link to GitHub usernames (done in release script instead)
]

[git]
Expand Down
3 changes: 1 addition & 2 deletions release
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ echo

# Update CHANGELOG.
git cliff --tag "$VERSION_TAG" -o CHANGELOG.md
sed -i.bak -e 's/ @\([a-zA-Z0-9]\([-a-zA-Z0-9]*[a-zA-Z0-9]\)\?\)/ [@\1](https:\/\/github.com\/\1)/g' CHANGELOG.md && rm CHANGELOG.md.bak

# Add all changes and commit.
git add -A
Expand All @@ -56,8 +57,6 @@ changelog=$(echo "$changelog" | sed -E 's/\[\#([0-9]+)\]\(https:\/\/github\.com\
changelog=$(echo "$changelog" | sed -E 's/\[([0-9a-f]+)\]\(https:\/\/github\.com\/welpo\/[^\/]+\/commit\/([0-9a-f]+)\)/\1/g')
# Remove scopes.
changelog=$(echo "$changelog" | sed -E 's/\*\(([^)]+)\)\* //g')
# Remove @author links, leaving just the username.
changelog=$(echo "$changelog" | sed -E 's/\[\@([a-zA-Z0-9_]+)\]\(https:\/\/github\.com\/[a-zA-Z0-9_]+\)/@\1/g')
# Remove markdown headers.
changelog=$(echo "$changelog" | sed -E 's/^#+ //g')
# Remove version comparison lines.
Expand Down

0 comments on commit 8de049a

Please sign in to comment.