| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- name: Tag public pricing module
- on:
- push:
- branches:
- - develop
- paths:
- - 'modules/pricing/public/**'
- concurrency:
- group: tag-public-pricing
- cancel-in-progress: false
- jobs:
- tag:
- name: Auto-increment and push tag
- runs-on: ubuntu-latest
- permissions:
- contents: write
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0
- - name: Compute next patch version
- id: version
- run: |
- # Find the latest tag matching modules/pricing/public/vX.Y.Z
- LATEST=$(git tag --list 'modules/pricing/public/v*' \
- | sort -V | tail -n1)
- if [ -z "$LATEST" ]; then
- # No tag exists yet — start at v1.0.0
- NEXT="modules/pricing/public/v1.0.0"
- else
- # Strip the prefix, split semver, bump patch
- VERSION="${LATEST#modules/pricing/public/v}"
- MAJOR=$(echo "$VERSION" | cut -d. -f1)
- MINOR=$(echo "$VERSION" | cut -d. -f2)
- PATCH=$(echo "$VERSION" | cut -d. -f3)
- NEXT="modules/pricing/public/v${MAJOR}.${MINOR}.$((PATCH + 1))"
- fi
- echo "tag=$NEXT" >> "$GITHUB_OUTPUT"
- echo "Next tag: $NEXT"
- - name: Push tag
- run: |
- git config user.name "github-actions[bot]"
- git config user.email "github-actions[bot]@users.noreply.github.com"
- git tag "${{ steps.version.outputs.tag }}"
- git push origin "${{ steps.version.outputs.tag }}"
|