Skip to content

Commit

Permalink
CI: fixup detection of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCrews committed Nov 5, 2024
1 parent ac145b4 commit 089362e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,26 @@ jobs:
env:
CI_COMMIT_MESSAGE: "chore: normalize data and re-sync"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
with:
# Need this commit and last. Otherwise would overwrite all history
# (don't ask how I know)
fetch-depth: 2
- uses: actions/setup-python@v5
- name: Normalize the .csv
run: python normalize.py
- name: Test that SQL data is up to date - normalized
run: python sql/generate_sql.py
- name: Check for changes
id: changes
run: git diff
run: |
git diff
echo "has_changes=$?"
- name: Amend and push changes
if: steps.changes.outputs.stdout != ''
if: steps.changes.has_changes != '0'
run: |
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
git add .
git commit --amend --no-edit
git push --force

0 comments on commit 089362e

Please sign in to comment.