Skip to content

Commit

Permalink
Add validation of "AUTHORS" file (#6722)
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Aug 1, 2020
1 parent 04a8d3e commit 125a0c1
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,35 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
checkauthors:
name: "Validate AUTHORS"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# full checkout needed for authors generation
fetch-depth: 0
- name: "Check AUTHORS"
id: authors_check
shell: bash
run: |
./scripts/generate-authors.sh
set +o pipefail
added=$(git diff HEAD --no-ext-diff --unified=0 -a --no-prefix | egrep "^\+[^+]" | sed "s/^\+//")
if [ -z "$added" ]; then
echo "::set-output name=newauthor::false"
echo "No authors added"
exit 0
fi
message="When merged, this pull request proposes to manually add the following to the [AUTHORS file](https://github.com/JabRef/jabref/blob/master/CONTRIBUTING.md#author-credits). In case you want to raise a different proposal, please comment here (we will adapt our `.mailmap` file then) or [adjust your name in your git configuration](https://docs.github.com/en/github/using-git/setting-your-username-in-git). You will have to [rewrite your git history](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History) and use `git commit --author="John Doe <john@doe.org>"` for each changed commit.%0A%0A\`\`\`%0A${added//$'\n'/'%0A'}%0A\`\`\`%0A"
echo "::set-output name=message::$message"
echo "::set-output name=newauthor::true"
echo "New authors found"
- name: Comment PR
uses: unsplash/comment-on-pr@master
if: steps.authors_check.outputs.newauthor == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: "${{ steps.authors_check.outputs.message }}"
check_for_duplicate_msg: true

0 comments on commit 125a0c1

Please sign in to comment.