GitVersion icon indicating copy to clipboard operation
GitVersion copied to clipboard

[Bug] Failing to detect branch when GitHub action is triggered from a comment on the pull request

Open abd3lraouf opened this issue 3 years ago • 6 comments

Describe the bug Failing to detect branch when GitHub action is triggered from a comment on the pull request

Expected Behavior

It should detect the branch name of the pull request.

Actual Behavior

it always says it's develop (the pr is from a feature branch into develop)

Context

I tried to get the branch name manually, so if there is a way I can provide the correct branch name to gitversion.

Your Environment

  • Operating System and version (Windows 10, Ubuntu 18.04): ubuntu-latest
  - name: Determine Version
    uses: gittools/actions/gitversion/[email protected]

abd3lraouf avatar Jul 14 '22 22:07 abd3lraouf

Have you tried providing the environment variable Git_Branch?

asbjornu avatar Aug 27 '22 22:08 asbjornu

Unfortunately, this is not our case, we use it to trigger the workflow on the PR branch, I cannot provide it manually.

abd3lraouf avatar Aug 28 '22 11:08 abd3lraouf

Ah, I see you're using GitHub Actions. I don't think Git_Branch should do anything to or from then. @arturcic, do you remember how gitversion/execute determines the branch name?

asbjornu avatar Aug 28 '22 20:08 asbjornu

The GitHub action as well as Azure DevOps task is just a wrapper for the global tool.

arturcic avatar Aug 29 '22 05:08 arturcic

So the action does nothing to convey the information about which branch is being built to the global tool? If not, we should probably do that, somehow. 🤔

asbjornu avatar Aug 29 '22 21:08 asbjornu

#3020 seems to contradict this, somehow?

asbjornu avatar Sep 03 '22 22:09 asbjornu

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.

github-actions[bot] avatar Mar 04 '23 09:03 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity. Thank you for your contributions

github-actions[bot] avatar Apr 03 '23 11:04 github-actions[bot]