2022-05-21 09:11:14 -07:00
|
|
|
#!/bin/bash
|
2023-07-12 21:00:02 -07:00
|
|
|
git config --local user.email "action@github.com"
|
|
|
|
git config --local user.name "GitHub create-board Action"
|
2023-07-15 12:56:06 -07:00
|
|
|
git add gerber/*
|
2023-07-12 21:00:02 -07:00
|
|
|
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"
|
2023-07-24 18:54:31 -07:00
|
|
|
if echo "$OUT" | grep 'nothing to commit' || echo "$OUT" | grep 'nothing added to commit'; then
|
2023-07-12 21:00:02 -07:00
|
|
|
echo "headers: looks like nothing to commit"
|
2023-07-26 08:45:20 -07:00
|
|
|
# todo: NOCOMMIT is deprecated I guess? YESCOMMIT works better with multiple invocations per action
|
2023-07-12 21:00:02 -07:00
|
|
|
echo "::set-env name=NOCOMMIT::true"
|
|
|
|
exit 0
|
|
|
|
elif echo "$OUT" | grep 'changed'; then
|
|
|
|
echo "headers: looks like something has changed"
|
2023-07-26 08:45:20 -07:00
|
|
|
echo "::set-env name=YESCOMMIT::true"
|
2023-07-12 21:00:02 -07:00
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
echo "headers: looks like something unexpected"
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-05-21 09:11:14 -07:00
|
|
|
|