Skip to content

Commit

Permalink
Do not bother committing if nothing to commit
Browse files Browse the repository at this point in the history
important since otherwise git commit exits with 1 and we fail ci run
  • Loading branch information
yarikoptic committed Nov 13, 2024
1 parent c351c4f commit c77874b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/inject-schema-fully-auto
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ if [ -n "$to_inject" ]; then
schema_version=$(cat "$version_folder/schema/SCHEMA_VERSION")
bids_version=$(cat "$version_folder/schema/BIDS_VERSION")
git add versions;
git commit -m "Injected schema $schema_version for BIDS $bids_version as of commit $committish into versions/$folder" -a
if git diff-index --quiet HEAD --; then
echo "Nothing to commit"
else
git commit -m "Injected schema $schema_version for BIDS $bids_version as of commit $committish into versions/$folder" -a
fi
done
fi
echo "done"

0 comments on commit c77874b

Please sign in to comment.