Skip to content

Commit

Permalink
Added check for new lines at the end of files in GitHub Actions (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
percona-ysorokin authored Mar 25, 2024
1 parent d4bae0e commit 8adf572
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
fetch-depth: 0
fetch-tags: true

- name: Check for new lines at the end of files
# https://medium.com/@alexey.inkin/how-to-force-newline-at-end-of-files-and-why-you-should-do-it-fdf76d1d090e
working-directory: ${{github.workspace}}/src
run: find . -not -path "./.git/*" -type f | xargs -L1 bash -c 'test -z "$(tail -c1 "$0")" || (echo "No newline at the end of $0" ; false)'

- name: Check formatting with git diff --check
working-directory: ${{github.workspace}}/src
run: git diff --check --color HEAD~
Expand Down

0 comments on commit 8adf572

Please sign in to comment.