Skip to content

Commit

Permalink
Merge pull request #11346 from dra27/commit-ignored
Browse files Browse the repository at this point in the history
CI check for committing files in .gitignore
  • Loading branch information
shindere committed Dec 23, 2022
2 parents 03957aa + b070d75 commit 0250779
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/hygiene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ jobs:
'${{ github.event.after }}'
if: ${{ always() }}

- name: Check that no ignored files have been committed
run: tools/ci/actions/check-no-ignored-files.sh
if: ${{ always() }}

- name: check-typo revered
run: >-
tools/ci/actions/check-typo.sh
Expand Down
19 changes: 19 additions & 0 deletions tools/ci/actions/check-no-ignored-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
#**************************************************************************
#* *
#* OCaml *
#* *
#* David Allsopp, Tarides *
#* *
#* Copyright 2022 David Allsopp Ltd. *
#* *
#* All rights reserved. This file is distributed under the terms of *
#* the GNU Lesser General Public License version 2.1, with the *
#* special exception on linking described in the file LICENSE. *
#* *
#**************************************************************************

if git ls-tree HEAD --name-only -r | git check-ignore --stdin --no-index; then
echo These files are matched by .gitignore and should not be committed
exit 1
fi

0 comments on commit 0250779

Please sign in to comment.