Skip to content

Commit f73ae3a

Browse files
Add CI mode handling for version bump confirmation
Signed-off-by: Karan Mohindroo <96403086+NullPointerDepressiveDisorder@users.noreply.github.com>
1 parent 2a8fccc commit f73ae3a

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

bump-version.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,20 @@ if git ls-remote --tags origin | grep -q "refs/tags/v$VERSION$"; then
5555
fi
5656

5757
# Stage and amend previous commit
58-
echo "⚠️ Warning: This will amend the last commit. Make sure it hasn't been pushed yet."
59-
read -p "Continue (y/n) " -n 1 -r
60-
echo
61-
if [[ ! "$REPLY" =~ ^[Yy]$ ]]; then
62-
echo "Aborted."
63-
exit 1
58+
if [ -z "$CI" ]; then
59+
# Only prompt in local/interactive environments
60+
echo "⚠️ Warning: This will amend the last commit. Make sure it hasn't been pushed yet."
61+
read -p "Continue (y/n)? " -n 1 -r
62+
echo
63+
if [[ ! "$REPLY" =~ ^[Yy]$ ]]; then
64+
echo "Aborted."
65+
exit 1
66+
fi
67+
else
68+
echo "⚠️ Warning: This will amend the last commit. Make sure it hasn't been pushed yet."
69+
echo "Running in CI mode, skipping confirmation..."
6470
fi
71+
6572
git add MiddleDrag.xcodeproj/project.pbxproj
6673
git commit --amend --no-edit
6774
echo "✓ Amended previous commit with version change"

0 commit comments

Comments
 (0)