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 <[email protected]>
Alban Dumouilla <[email protected]> <[email protected]>
Alexandre Pinot <[email protected]>
Alexandre Pinot <[email protected]> <[email protected]>
Aubin Tchoi <[email protected]>
Aubin Tchoi <[email protected]> <[email protected]>
Aubin Tchoi <[email protected]> <[email protected]>
Daphné Popin <[email protected]>
Daphné Popin <[email protected]> <[email protected]>
Daphné Popin <[email protected]> <[email protected]>
Edouard Wautier <[email protected]>
Edouard Wautier <[email protected]> <[email protected]>
Flavien David <[email protected]>
Flavien David <[email protected]> <[email protected]>
Gabriel Hubert <[email protected]>
Gabriel Hubert <[email protected]> <[email protected]>
Henry Fontanier <[email protected]>
Henry Fontanier <[email protected]> <[email protected]>
Jules Belveze <[email protected]>
Jules Belveze <[email protected]> <[email protected]>
Jules Belveze <[email protected]> <[email protected]>
Lucas Massemin <[email protected]>
Lucas Massemin <[email protected]> <[email protected]>
Pauline Pham <[email protected]>
Pauline Pham <[email protected]> <[email protected]>
Philippe Rolet <[email protected]>
Philippe Rolet <[email protected]> <[email protected]>
Sebastien Flory <[email protected]>
Sebastien Flory <[email protected]> <[email protected]>
Stanislas Polu <[email protected]>
Stanislas Polu <[email protected]> <[email protected]>
Thibault Martin <[email protected]>
Thibault Martin <[email protected]> <[email protected]>
Thomas Draier <[email protected]>
Thomas Draier <[email protected]> <[email protected]>
JulesBelveze [email protected]
pinotalexandre [email protected]
aubin-tchoi [email protected]
PopDaph [email protected]
Duncid [email protected]
flavien [email protected]
gabriel [email protected]
henry [email protected]
lucasmassemin [email protected]
Yutcam [email protected]
philipperolet [email protected]
sflory [email protected]
spolu [email protected]
thib-martin [email protected]
thomas [email protected]

0 comments on commit 8d411cd

Please sign in to comment.