Skip to content

Commit 5b54a6f

Browse files
committed
feat(pipeline): enhance build number extraction logic
- Adds a new command to the settings for grep functionality. - Simplifies the build number extraction process by clarifying that if no matching tags exist, the build number will default to 1. - Improves clarity in versioning logic for better maintainability.
1 parent d9f3070 commit 5b54a6f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"Bash(ls:*)",
2424
"Bash(git add:*)",
2525
"Bash(git commit:*)",
26-
"Bash(git rm:*)"
26+
"Bash(git rm:*)",
27+
"Bash(grep:*)"
2728
],
2829
"deny": []
2930
}

.github/workflows/pipeline.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,8 @@ jobs:
6464
# Extract the build number from the last tag and increment
6565
LAST_BUILD=$(echo "$LAST_TAG" | sed "s/v${BASE_VERSION}+//")
6666
BUILD_NUMBER=$((LAST_BUILD + 1))
67-
else
68-
# Count commits since we started using this base version
69-
BUILD_NUMBER=$(git rev-list --count HEAD 2>/dev/null || echo 1)
7067
fi
68+
# If no matching tags exist for this base version, BUILD_NUMBER stays at 1
7169
7270
FULL_VERSION="${BASE_VERSION}+${BUILD_NUMBER}"
7371
echo "Full version with build metadata: $FULL_VERSION"

0 commit comments

Comments
 (0)