Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't commit files if only date or Kicad version changed #315

Merged
merged 2 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/create-board.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bin/gha-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down