This repository was archived by the owner on Mar 16, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9595 bash generation/update_owlbot_postprocessor_config.sh
9696 - name : Fail if there's any difference
9797 run : git --no-pager diff --exit-code
98+
99+ gitignore_correctness :
100+ name : Generated files should not match gitignore
101+ runs-on : ubuntu-latest
102+ steps :
103+ - uses : actions/checkout@v3
104+ - name : checking any files matching gitignore
105+ # By default, GitHub Actions's bash has '-e' option to fail immediately
106+ # upon non-zero exit code. Not using it here to catch the exit code 1.
107+ shell : /usr/bin/bash --noprofile --norc -o pipefail {0}
108+ run : |
109+ find . -type f -name '*.java' -not -path './.git/*' \
110+ |git check-ignore --no-index --verbose --stdin
111+ # https://git-scm.com/docs/git-check-ignore returns 1 when there's no
112+ # matching files with the gitignore file.
113+ # "--no-index" is needed to check against tracked files.
114+ if [ "$?" == 1 ]; then
115+ echo "No matching files. Good."
116+ exit 0
117+ else
118+ echo "There are gitignore matching files. Please adjust .gitignore."
119+ exit 1
120+ fi
121+
Original file line number Diff line number Diff line change @@ -48,9 +48,6 @@ nosetests.xml
4848.DS_Store
4949.classpath
5050
51- # Built documentation
52- docs /
53-
5451# API key file containing value of GOOGLE_API_KEY for integration tests
5552api_key
5653
You can’t perform that action at this time.
0 commit comments