Skip to content

Commit

Permalink
Ensure exit code on git diff can cause failure as well
Browse files Browse the repository at this point in the history
  • Loading branch information
yosifkit authored and tianon committed Aug 24, 2020
1 parent 78d81cf commit 1724163
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .ci/check-pr-no-readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ set -Eeuo pipefail
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.."

git fetch -q https://github.com/docker-library/docs.git master
if [ -n "$(git diff --numstat FETCH_HEAD...HEAD -- '*/README.md')" ]; then
numstat="$(git diff --numstat FETCH_HEAD...HEAD -- '*/README.md')"
if [ -n "$numstat" ]; then
echo >&2 'Error: at least one repo README.md has changed'
echo >&2 'These files are autogenerated, so it is unnecessary to modify them'
echo >&2 'Please update content.md and docker-library-bot will take care of README.md'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: .ci/check-pr-no-readme.sh
if: ${{ github.event_name == 'pull_request' }}

0 comments on commit 1724163

Please sign in to comment.