Skip to content

Commit

Permalink
Merge pull request #25 from ruedigerp/develop
Browse files Browse the repository at this point in the history
fix: add fix, feat, core
  • Loading branch information
ruedigerp authored Dec 11, 2024
2 parents be5207e + dd06fe4 commit b571161
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,42 @@ jobs:
- name: Bump version
id: bump_version
run: |
version=${tag/v/} # Entfernt das 'v' vor der Version
# Neueste Commit-Nachricht abrufen
commit_message=$(git log -1 --pretty=%B)
# Alte Version ohne das 'v'
version=${tag/v/}
# Version in Major, Minor, Patch aufteilen
IFS='.' read -r major minor patch <<< "$version"
patch=$((patch + 1)) # Erhöht die Patch-Version
# Basierend auf Commit-Nachricht die Version erhöhen
if [[ "$commit_message" == fix:* ]]; then
patch=$((patch + 1)) # Patch erhöhen
elif [[ "$commit_message" == feat:* ]]; then
minor=$((minor + 1)) # Minor erhöhen
patch=0 # Patch zurücksetzen
elif [[ "$commit_message" == chore:* ]]; then
major=$((major + 1)) # Major erhöhen
minor=0 # Minor zurücksetzen
patch=0 # Patch zurücksetzen
else
echo "No version bump for commit message: $commit_message"
exit 0
fi
# Neue Version erstellen
new_version="v${major}.${minor}.${patch}"
echo "new_version=$new_version" >> $GITHUB_ENV
echo "Bumped version based on commit message '$commit_message' to $new_version"
# version=${tag/v/} # Entfernt das 'v' vor der Version
# IFS='.' read -r major minor patch <<< "$version"
# patch=$((patch + 1)) # Erhöht die Patch-Version
# new_version="v${major}.${minor}.${patch}"
# echo "new_version=$new_version" >> $GITHUB_ENV
- name: Create new tag
run: |
git config user.name "github-actions[bot]"
Expand Down

0 comments on commit b571161

Please sign in to comment.