Skip to content

Commit

Permalink
Add bot comment with directions to update .mailmap (#1982)
Browse files Browse the repository at this point in the history
* Add bot comment with directions to update .mailmap

* Edit comment content

* Rename workflow file
  • Loading branch information
epassaro authored Apr 27, 2022
1 parent c5f4900 commit 04bded6
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 28 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/mailmap-check.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/mailmap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# For more information on how to use this template please refer to:
# http://tardis-sn.github.io/tardis/development/continuous_integration.html

name: mailmap

on:
pull_request_target:
branches:
- master

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Check PR authors
run: cat .mailmap | grep "$(git log $PR_BASE_SHA..HEAD --pretty='%aN <%aE>')"
env:
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}

- name: Error message
run: |
echo "Committer name or email couldn't be found in .mailmap"
echo; git log $PR_BASE_SHA..HEAD --pretty='%aN <%aE>'
if: failure()
- name: Create comment
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.BOT_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body: |
*\*beep\* \*bop\**
Hi, human.
I'm the @tardis-bot and couldn't find your records in my database. I think we don't know each other, or you changed your credentials recently.
Please add your **name** and **email** to `.mailmap` in your current branch and push the changes to this pull request.
In case you need to map an existing alias, follow [this example](https://docs.enterprise.codescene.io/versions/2.0.0/getting-started/ensure-you-use-a-mailmap.html).
if: failure()

0 comments on commit 04bded6

Please sign in to comment.