reducing code duplication

This commit is contained in:
rusefillc 2022-05-21 12:11:14 -04:00
parent 42a4335986
commit ccce677b95
1 changed files with 19 additions and 0 deletions

19
bin/gha-commit.sh Normal file
View File

@ -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