From ccce677b95ae221da30ae894b5222f4e286799dc Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sat, 21 May 2022 12:11:14 -0400 Subject: [PATCH] reducing code duplication --- bin/gha-commit.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 bin/gha-commit.sh diff --git a/bin/gha-commit.sh b/bin/gha-commit.sh new file mode 100644 index 0000000..f1c5e7e --- /dev/null +++ b/bin/gha-commit.sh @@ -0,0 +1,19 @@ +#!/bin/bash + + git config --local user.email "action@github.com" + git config --local user.name "GitHub create-board Action" + git add boards/* + git status + OUT=$(git commit -am "Auto-generated board" 2>&1) || echo "commit failed, finding out why" + if echo "$OUT" | grep 'nothing to commit'; then + echo "headers: looks like nothing to commit" + echo "::set-env name=NOCOMMIT::true" + exit 0 + elif echo "$OUT" | grep 'changed'; then + echo "headers: looks like something has changed" + exit 0 + else + echo "headers: looks like something unexpected" + exit 1 + fi +