Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TS-653] Version does not consider base branch #92

Open
jsmith-kno2 opened this issue Nov 7, 2023 · 2 comments
Open

[TS-653] Version does not consider base branch #92

jsmith-kno2 opened this issue Nov 7, 2023 · 2 comments
Labels
jira-issue Issue tracked on JIRA

Comments

@jsmith-kno2
Copy link

I have the following branching strategy:

master -> rc -> feature branch
master -> hotfix

Nothing remarkable; master represents what's in prod. We work in sprints, so the rc branch represents the accumulated sprint work. Occasionally we have an issue in prod that requires immediate resolution. In those cases, we branch from master to develop the hotfix. After the hotfix is merged into master, we need to merge those changes forward into rc.

I'm encountering an issue with the generated version when performing this merge forward from master to rc. I expected the version to be a pre-release as the base is not the default branch but instead it's generating a full release version because the current branch is the default branch.

Any suggestions or is this something that should possibly be considered in the version generation code?

Copy link

github-actions bot commented Nov 7, 2023

Internal ticket created : TS-653

@github-actions github-actions bot added the jira-issue Issue tracked on JIRA label Nov 7, 2023
@github-actions github-actions bot changed the title Version does not consider base branch [TS-653] Version does not consider base branch Nov 7, 2023
@jsmith-kno2
Copy link
Author

In the off chance someone else comes across this problem and needs an immediate solution, this is how I've created a workaround:

        id: override
        run: |
          if [[ "$GITHUB_BASE_REF" == "rc" && "$GITHUB_HEAD_REF" == "master" ]]; then
            echo "release_branch=something_other_than_master_to_force_prerelease_version_generation" >> $GITHUB_ENV
          else
            echo "release_branch=master" >> $GITHUB_ENV
          fi
      - name: Generate new version
        id: version
        uses: codacy/git-version@2.8.0
        with:
          release-branch: ${{ steps.override.outputs.release_branch}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-issue Issue tracked on JIRA
Projects
None yet
Development

No branches or pull requests

1 participant