Browse Source

fix(ci) make the "dirty git tree" CI failure clearer

Print the git diff output in the step which fails.
master
Saúl Ibarra Corretgé 3 years ago
parent
commit
d2c4e81e25
1 changed files with 1 additions and 3 deletions
  1. 1
    3
      .github/workflows/ci.yml

+ 1
- 3
.github/workflows/ci.yml View File

16
       run: git status
16
       run: git status
17
     - name: Normalize lang files to ensure sorted
17
     - name: Normalize lang files to ensure sorted
18
       run: npm run lang-sort
18
       run: npm run lang-sort
19
-    - name: Check git diff
20
-      run: git diff
21
     - name: Check if the git repository is clean
19
     - name: Check if the git repository is clean
22
-      run: exit $( git status --porcelain --untracked-files=no | head -255 | wc -l )
20
+      run: $(exit $(git status --porcelain --untracked-files=no | head -255 | wc -l)) || (echo "Dirty git tree"; git diff; exit 1)
23
     - run: npm run lint
21
     - run: npm run lint
24
     - run: for file in lang/*.json; do npx --yes jsonlint -q $file || exit 1; done
22
     - run: for file in lang/*.json; do npx --yes jsonlint -q $file || exit 1; done
25
     - run: make
23
     - run: make

Loading…
Cancel
Save