codacy / git-version

Git versioning used in Codacy
Apache License 2.0
135 stars 43 forks source link

[CY-5495] wrong tag on develop branch #54

Open tamer-abdulghani opened 2 years ago

tamer-abdulghani commented 2 years ago

Problem version calculation on develop branch is always starting with 1.0.0.SNAPSHOT eventhough the main branch is tagged with 2.0.0 below photo shows how develop branch is tagged after main branch with wrong tag:

1develop

Workflow actions

Here is the actions that I used in my repository workflow:

- name: Git Version
  id: version
  uses: codacy/git-version@2.2.0
  with:
     release-branch: main
     dev-branch: develop

- name: Tagging
  uses: actions/github-script@v5
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    script: |
      github.rest.git.createRef({
        owner: context.repo.owner,
        repo: context.repo.repo,
        ref: 'refs/tags/${{ needs.versioning.outputs.version }}',
        sha: context.sha
      })
github-actions[bot] commented 2 years ago

Internal ticket created : CY-5495