This commit is contained in:
u00lipp
2025-10-29 11:10:25 +01:00
parent b083163efb
commit d6619a5a26
+10 -4
View File
@@ -8,6 +8,10 @@ on:
branches: branches:
- main - main
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: false
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -20,7 +24,7 @@ jobs:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
fetch-depth: 0 # Fetch full history for branch info fetch-depth: 0 # Full history for branch info
- name: Validate Conventional Commits - name: Validate Conventional Commits
id: validate_commits id: validate_commits
@@ -31,20 +35,22 @@ jobs:
echo "valid=false" >> $GITHUB_ENV echo "valid=false" >> $GITHUB_ENV
fi fi
# Only run semantic version calculation if commit message is valid - name: Determine Branch Name
run: |
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Calculate Semantic Version tag - name: Calculate Semantic Version tag
if: env.valid == 'true' if: env.valid == 'true'
id: semver id: semver
uses: gandarez/semver-action@v2.0.0 uses: gandarez/semver-action@v2.0.0
with: with:
main_branch_name: main main_branch_name: main
source_branch: ${{ github.head_ref || github.ref }} source_branch: ${{ env.BRANCH_NAME }}
- name: Extract Variables - name: Extract Variables
if: env.valid == 'true' if: env.valid == 'true'
run: | run: |
echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
echo "SEMVER_TAG=${{ steps.semver.outputs.semver_tag }}" >> $GITHUB_ENV echo "SEMVER_TAG=${{ steps.semver.outputs.semver_tag }}" >> $GITHUB_ENV
- name: Docker Login - name: Docker Login