Skip to content

Commit fe94f56

Browse files
workflows: check commit for ignored files (#2685)
1 parent b5c0046 commit fe94f56

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,23 @@ jobs:
3838
- name: Spellcheck
3939
run: npm run check:spelling
4040

41+
checkForCommonlyIgnoredFiles:
42+
name: Check for commonly ignored files
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout repo
46+
uses: actions/checkout@v2
47+
48+
- name: Check if commit contains files that should be ignored
49+
run: |
50+
git clone --depth 1 https://github.com/github/gitignore.git &&
51+
cat gitignore/Node.gitignore $(find gitignore/Global -name "*.gitignore" | grep -v ModelSim) > all.gitignore &&
52+
if [[ "$(git ls-files -iX all.gitignore)" != "" ]]; then
53+
echo "::error::Please remove these files:"
54+
git ls-files -iX all.gitignore
55+
exit 1
56+
fi
57+
4158
integrationTests:
4259
name: Run integration tests
4360
runs-on: ubuntu-latest
@@ -187,7 +204,7 @@ jobs:
187204
github.event_name == 'push' &&
188205
github.repository == 'graphql/graphql-js' &&
189206
github.ref == 'refs/heads/master'
190-
needs: [test, fuzz, lint, integrationTests]
207+
needs: [test, fuzz, lint, checkForCommonlyIgnoredFiles, integrationTests]
191208
steps:
192209
- name: Checkout repo
193210
uses: actions/checkout@v2
@@ -223,7 +240,7 @@ jobs:
223240
github.event_name == 'push' &&
224241
github.repository == 'graphql/graphql-js' &&
225242
github.ref == 'refs/heads/master'
226-
needs: [test, fuzz, lint, integrationTests]
243+
needs: [test, fuzz, lint, checkForCommonlyIgnoredFiles, integrationTests]
227244
steps:
228245
- name: Checkout repo
229246
uses: actions/checkout@v2

0 commit comments

Comments
 (0)