Add error handling for git operations
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -43,6 +43,15 @@ echo "$NEW_VERSION" > "$VERSION_FILE"
|
|||||||
echo "version: $NEW_VERSION" > "$VERSION_YAML_FILE"
|
echo "version: $NEW_VERSION" > "$VERSION_YAML_FILE"
|
||||||
|
|
||||||
# Commit and tag
|
# Commit and tag
|
||||||
git add "$VERSION_FILE" "$VERSION_YAML_FILE"
|
if ! git add "$VERSION_FILE" "$VERSION_YAML_FILE"; then
|
||||||
git commit -m "Bump version to $NEW_VERSION"
|
echo "Error: Failed to stage version files"
|
||||||
git tag "v$NEW_VERSION"
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! git commit -m "Bump version to $NEW_VERSION"; then
|
||||||
|
echo "Error: Failed to commit version bump"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! git tag "v$NEW_VERSION"; then
|
||||||
|
echo "Error: Failed to create version tag"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user