-
-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bot comment with directions to update .mailmap (#1982)
* Add bot comment with directions to update .mailmap * Edit comment content * Rename workflow file
- Loading branch information
Showing
2 changed files
with
46 additions
and
28 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |