reecetech / version-increment

GitHub Action that increments semver or calver versions based on git repository tags
The Unlicense
43 stars 15 forks source link

Tag prepended with label not working #34

Closed sefasenturk95 closed 1 week ago

sefasenturk95 commented 2 weeks ago

I am trying to create tags using this package. It works fine when only using the bare tag but when you prepend the tag with a label it doesn't work.

  tag-commit:
    needs: deploy-to-prod
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Get next version
        uses: reecetech/version-increment@2024.4.3
        id: version
        with:
          scheme: calver

      - name: Push Git Tag
        run: |
          git config user.name "GitHub Actions"
          git config user.email "github-actions@users.noreply.github.com"
          git tag "@org/${{secrets.PRODUCT_NAME}}@${{ steps.version.outputs.version }}"
          git push origin "@org/${{secrets.PRODUCT_NAME}}@v${{ steps.version.outputs.version }}"

when configured like this it keeps on selecting .0 as base version:

Run reecetech/version-increment@2024.4.3
  with:
    scheme: calver
    pep440: false
    increment: patch
    use_api: false
Run ${GITHUB_ACTION_PATH}/version-lookup.sh
⚠️ No previous release version identified in git tags
ℹ️ The current normal version is 2024.8.0
Run ${GITHUB_ACTION_PATH}/version-increment.sh
ℹ️ The new version is 2024.8.1
ps-jay commented 2 weeks ago

Yes, that would be expected

The action doesn't know how to ignore all the text before the version number

Not the issue, but I noticed you have a "v" character in the push, but not in the tag?

git tag "@org/${{secrets.PRODUCT_NAME}}@${{ steps.version.outputs.version }}"
git push origin "@org/${{secrets.PRODUCT_NAME}}@v${{ steps.version.outputs.version }}"
sefasenturk95 commented 2 weeks ago

@ps-jay , Ah thanks for noticing. I'll update that. Any way I can let the action know that the tag has a prefix?

ps-jay commented 1 week ago

From version 2024.9.1 this is implemented:

      - name: Checkout code
        uses: actions/checkout@v4

      - name: Get next version
        uses: reecetech/version-increment@2024.9.1
        id: version
        with:
          tag_prefix: "release/"