diff --git a/.github/workflows/create-board.yaml b/.github/workflows/create-board.yaml index 89c5809..4d8bf52 100644 --- a/.github/workflows/create-board.yaml +++ b/.github/workflows/create-board.yaml @@ -52,6 +52,11 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' run: | + git diff --name-only | while read f; do + if [ $(git diff --color=always|perl -wlne 'print $1 if /^\e\[32m\+\e\[m\e\[32m(.*)\e\[m$/' "$f" | grep -vE "Created|Generation|[dD]ate" | wc -l) -eq 0 ]; then + git checkout "$f" + fi + done bash hellen-one/bin/gha-commit.sh - name: Push board files diff --git a/bin/gha-commit.sh b/bin/gha-commit.sh index 35e313f..70cc89e 100644 --- a/bin/gha-commit.sh +++ b/bin/gha-commit.sh @@ -6,7 +6,7 @@ git add boards/* git reset HEAD *.kicad_pro git status OUT=$(git commit -am "[skip actions] Auto-generated board" 2>&1) || echo "commit failed, finding out why" -if echo "$OUT" | grep 'nothing to commit'; then +if echo "$OUT" | grep 'nothing to commit' || echo "$OUT" | grep 'nothing added to commit'; then echo "headers: looks like nothing to commit" echo "::set-env name=NOCOMMIT::true" exit 0