Skip to content

Commit

Permalink
Replace comment by just a failure (#6943)
Browse files Browse the repository at this point in the history
- Consistent to other checkers (e.g., checkstyle)
- Commenting only works if maintainers create the PR
  • Loading branch information
koppor authored Sep 24, 2020
1 parent e3fc4fc commit 75b6770
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ jobs:
with:
# full checkout needed for authors generation
fetch-depth: 0
- name: "Check AUTHORS"
- name: "All authors of this PR listed in AUTHORS"
id: authors_check
shell: bash
run: |
Expand All @@ -245,19 +245,16 @@ jobs:
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="The JabRef maintainers will add the following name to the [AUTHORS file](https://github.com/JabRef/jabref/blob/master/CONTRIBUTING.md#author-credits). In case you want to use a different one, please comment here and [adjust your name in your git configuration](https://docs.github.com/en/github/using-git/setting-your-username-in-git) for future commits.%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.GH_TOKEN_COMMENT_ON_PR }}
with:
msg: "${{ steps.authors_check.outputs.message }}"
check_for_duplicate_msg: true
echo "Authors found in this PR not listed in the AUTHORS file."
echo
echo "The JabRef maintainers will add the following name to the AUTHORS file"
echo
echo -e "$added"
echo
echo "In case you want to use a different one, please comment here and adjust your name in your git configuration for future commits"
echo
echo "Background: Information about the AUTHORS file can be found at https://github.com/JabRef/jabref/blob/master/CONTRIBUTING.md#author-credits"
exit 1

0 comments on commit 75b6770

Please sign in to comment.