Skip to content

Commit

Permalink
[.github] - refactor: mention workflow author in slack (#8967)
Browse files Browse the repository at this point in the history
* [.github] - refactor: simplify retrieval of commit author information in slack-notify action

 - Use the GitHub actor as the commit author name and email instead of extracting from the git log
 - Set the author email to a no-reply GitHub address associated with the GitHub actor

* [.github/.mailmap] - refactor: streamline mailmap and GitHub action for Slack notifications

 - Modified the GitHub action to look up the author email using the improved mailmap
 - Simplified the mailmap file to map GitHub usernames directly to their dust email addresses

* [.mailmap] - refactor: clean up trailing whitespace

 - Remove the unnecessary empty line at the end of the .mailmap file
  • Loading branch information
JulesBelveze authored Nov 27, 2024
1 parent 6de63dc commit 8d411cd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 49 deletions.
21 changes: 7 additions & 14 deletions .github/actions/slack-notify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,20 @@ outputs:
runs:
using: "composite"
steps:
- name: Get author email
- name: Get author info
if: inputs.step == 'start'
id: author
shell: bash
run: |
# Get last commit author name and email
AUTHOR_NAME=$(git log -1 --format='%an')
AUTHOR_EMAIL=$(git log -1 --format='%ae')
AUTHOR_NAME="${{ github.actor }}"
if ! CANONICAL=$(git check-mailmap "$AUTHOR_NAME <$AUTHOR_EMAIL>" 2>/dev/null); then
echo "email=$AUTHOR_EMAIL" >> $GITHUB_OUTPUT
echo "name=$AUTHOR_NAME" >> $GITHUB_OUTPUT
exit 0
if ! EMAIL=$(git check-mailmap "$AUTHOR_NAME" 2>/dev/null); then
echo "GitHub handle $AUTHOR_NAME not found in mailmap" >&2
exit 1
fi
# Extract email and name from canonical form
CANONICAL_EMAIL=$(echo "$CANONICAL" | grep -o '<.*>' | tr -d '<>')
CANONICAL_NAME=$(echo "$CANONICAL" | sed 's/ <.*>//')
echo "email=$CANONICAL_EMAIL" >> $GITHUB_OUTPUT
echo "name=$CANONICAL_NAME" >> $GITHUB_OUTPUT
echo "email=$EMAIL" >> $GITHUB_OUTPUT
echo "name=$AUTHOR_NAME" >> $GITHUB_OUTPUT
- name: Lookup by email
if: inputs.step == 'start'
Expand Down
50 changes: 15 additions & 35 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -1,35 +1,15 @@
Alban Dumouilla <alban@dust.tt>
Alban Dumouilla <alban@dust.tt> <alban.dumouilla@gmail.com>
Alexandre Pinot <alexandre@dust.tt>
Alexandre Pinot <alexandre@dust.tt> <32997243+pinotalexandre@users.noreply.github.com>
Aubin Tchoi <aubin@dust.tt>
Aubin Tchoi <aubin@dust.tt> <60398825+aubin-tchoi@users.noreply.github.com>
Aubin Tchoi <aubin@dust.tt> <aubin.tchoi@gmail.com>
Daphné Popin <daph@dust.tt>
Daphné Popin <daph@dust.tt> <daphne.popin@gmail.com>
Daphné Popin <daph@dust.tt> <PopDaph@users.noreply.github.com>
Edouard Wautier <ed@dust.tt>
Edouard Wautier <ed@dust.tt> <4435185+Duncid@users.noreply.github.com>
Flavien David <flavien@dust.tt>
Flavien David <flavien@dust.tt> <flavien.david74@gmail.com>
Gabriel Hubert <gabriel@dust.tt>
Gabriel Hubert <gabriel@dust.tt> <gabriel.hubert@gmail.com>
Henry Fontanier <henry@dust.tt>
Henry Fontanier <henry@dust.tt> <h.fontanier@gmail.com>
Jules Belveze <jules@dust.tt>
Jules Belveze <jules@dust.tt> <32683010+JulesBelveze@users.noreply.github.com>
Jules Belveze <jules@dust.tt> <jules.belveze@hotmail.fr>
Lucas Massemin <lucas@dust.tt>
Lucas Massemin <lucas@dust.tt> <lucasmassemin@gmail.com>
Pauline Pham <pauline@dust.tt>
Pauline Pham <pauline@dust.tt> <33726902+Yutcam@users.noreply.github.com>
Philippe Rolet <pr@dust.tt>
Philippe Rolet <pr@dust.tt> <philipperolet@gmail.com>
Sebastien Flory <seb@dust.tt>
Sebastien Flory <seb@dust.tt> <sflory@gmail.com>
Stanislas Polu <spolu@dust.tt>
Stanislas Polu <spolu@dust.tt> <spolu@proton.me>
Thibault Martin <thibault@dust.tt>
Thibault Martin <thibault@dust.tt> <168569391+thib-martin@users.noreply.github.com>
Thomas Draier <thomas@dust.tt>
Thomas Draier <thomas@dust.tt> <thomas.draier@gmail.com>
JulesBelveze jules@dust.tt
pinotalexandre alexandre@dust.tt
aubin-tchoi aubin@dust.tt
PopDaph daph@dust.tt
Duncid ed@dust.tt
flavien flavien@dust.tt
gabriel gabriel@dust.tt
henry henry@dust.tt
lucasmassemin lucas@dust.tt
Yutcam pauline@dust.tt
philipperolet pr@dust.tt
sflory seb@dust.tt
spolu spolu@dust.tt
thib-martin thibault@dust.tt
thomas thomas@dust.tt

0 comments on commit 8d411cd

Please sign in to comment.