From 993eaa22c7dd3b47fb0a44d827fe98f49bb7c7c5 Mon Sep 17 00:00:00 2001 From: David Holdeman Date: Mon, 24 Jul 2023 19:53:02 -0500 Subject: [PATCH 1/2] check for date-only or version-only changes --- .github/workflows/create-board.yaml | 5 +++++ 1 file changed, 5 insertions(+) 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 From 3dc2727c0f709a955fe5328d09c9a76da98c3532 Mon Sep 17 00:00:00 2001 From: David Holdeman Date: Mon, 24 Jul 2023 20:54:31 -0500 Subject: [PATCH 2/2] allow for files changed but not in commit --- bin/gha-commit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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