Skip to content

Commit 15f048f

Browse files
committed
ci: Stop trying to hack bash to check for changes
1 parent 8197313 commit 15f048f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/check_for_changes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import subprocess
2+
3+
output = subprocess.run(["git", "status", "--porcelain"], capture_output=True, check=True).stdout
4+
5+
if output == b"":
6+
# No changes
7+
exit(0)
8+
9+
print(output)
10+
exit(1)

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
run: |
109109
poetry run openapi-python-client update --url http://localhost:3000/openapi.json --config integration-tests-config.yaml
110110
- name: Check for any file changes
111-
run: changed_files=$(git status --porcelain | wc -l) && [ changed_files != 0 ] && exit 1
111+
run: python .github/check_for_changes.py
112112
- name: Cache Generated Client Dependencies
113113
uses: actions/cache@v2
114114
with:

0 commit comments

Comments
 (0)