Skip to content

Commit

Permalink
GH actions: fix 'checkForCommonlyIgnoredFiles' (graphql#3613)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov authored May 28, 2022
1 parent dbf142f commit dae90de
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ jobs:

- name: Check if commit contains files that should be ignored
run: |
git clone --depth 1 https://github.com/github/gitignore.git &&
cat gitignore/Node.gitignore $(find gitignore/Global -name "*.gitignore" | grep -v ModelSim) > all.gitignore &&
if [[ "$(git ls-files -iX all.gitignore)" != "" ]]; then
echo "::error::Please remove these files:"
git ls-files -iX all.gitignore
git clone --depth 1 https://github.com/github/gitignore.git
rm gitignore/Global/ModelSim.gitignore
rm gitignore/Global/Images.gitignore
cat gitignore/Node.gitignore gitignore/Global/*.gitignore > all.gitignore
IGNORED_FILES=$(git ls-files --cached --ignored --exclude-from=all.gitignore)
if [[ "$IGNORED_FILES" != "" ]]; then
echo -e "::error::Please remove these files:\n$IGNORED_FILES" | sed -z 's/\n/%0A/g'
exit 1
fi
Expand Down

0 comments on commit dae90de

Please sign in to comment.