adamralph / minver

🏷 Minimalistic versioning using Git tags.
Apache License 2.0
825 stars 59 forks source link

Calculated height varies between local git and GitHub Actions #990

Closed gimlichael closed 3 months ago

gimlichael commented 3 months ago

So while transitioning from AzDO Pipelines to GitHub Actions, I noticed an odd behavior before even adding tags and whatnot. Note, in time of writing, I am just playing around to get a grasp on how this new pipeline is working .. so apologies if something looks odd.

Version(s)

MinVer 5.0.0

To reproduce

Steps to reproduce the behaviour:

  1. Clone https://github.com/codebeltnet/shared-kernel
  2. type minver in the directory for Windows, Bash (Git) and Bash (WSL)
  3. Notice height (for 499ac00) is 25
  4. https://github.com/codebeltnet/shared-kernel/actions/runs/8507904678/job/23300583945 image

Expected behaviour

I am no git expert - but I would expect the following from all environments:

MinVer: No commit found with a valid SemVer 2.0 version. Using default version 0.0.0-alpha.0.
MinVer: Using { Commit: 499ac00, Tag: '', Version: 0.0.0-alpha.0, Height: 25 }.
MinVer: Calculated version 0.0.0-alpha.0.25.
0.0.0-alpha.0.25

Actual behaviour

Local (Windows, Git Bash, Bash WSL - Ubuntu 22.04):

MinVer: No commit found with a valid SemVer 2.0 version. Using default version 0.0.0-alpha.0.
MinVer: Using { Commit: 5ef3567, Tag: '', Version: 0.0.0-alpha.0, Height: 25 }.
MinVer: Calculated version 0.0.0-alpha.0.25.
0.0.0-alpha.0.25

GitHub:

MinVer: No commit found with a valid SemVer 2.0 version. Using default version 0.0.0-alpha.0.
MinVer: Using *** Commit: 5ef3567, Tag: '', Version: 0.0.0-alpha.0, Height: 8 ***.
MinVer: Calculated version 0.0.0-alpha.0.8.

Additional context

My apologies in advance if I have overseen or misunderstood how to use your otherwise great tool.

GitHub action i use to checkout: https://github.com/codebeltnet/pipelines/blob/main/.github/actions/gh-checkout/action.yml GitHub action i use to calculate version: https://github.com/codebeltnet/pipelines/blob/main/.github/actions/minver-version/action.yml

adamralph commented 3 months ago

There's probably something different between the local and GHA working directories. The first thing I would do is turn the verbosity up to trace so you can see exactly how MinVer is arriving at the two different heights.

gimlichael commented 3 months ago

Thank you for taking your time to reply.

As you already hinted, something is different .. so the good thing is, that your tool is working .. the bad thing is, that I need to investigate why the GitHub repo is different from my local repo (i did mention I was not an expert git user).

I will close with thanks - but leave it so others may learn from my mistake :-)

PS Thanks for the log level tip!

Full log from local:

MinVer: MinVer 5.0.0+e17745c3a16e1b64a4863b4e780ca179b34ac38f.
MinVer: Running Git: git status --short
MinVer: Git exit code: 0
MinVer: Git stdout:
MinVer:  M .github/workflows/pipelines.yml
MinVer:
MinVer: Git stderr:
MinVer:
MinVer: Running Git: git log --pretty=format:"%H %P"
MinVer: Git exit code: 0
MinVer: Git stdout:
MinVer: 04a9c0573400bc7857de96d77cea763039df6693 499ac007269a8c6c75159de7ca4132f1fe006692
MinVer: 499ac007269a8c6c75159de7ca4132f1fe006692 f1e06deaa08285e15bb7a385094ffec7a1efbddb
MinVer: f1e06deaa08285e15bb7a385094ffec7a1efbddb 4d4f1da7ccc2f52ac61236f809d6e6dce037d24e
MinVer: 4d4f1da7ccc2f52ac61236f809d6e6dce037d24e 3799532c491a1fcb8f19da3d9e74e407a1cb8b43
MinVer: 3799532c491a1fcb8f19da3d9e74e407a1cb8b43 c1bf097a504116b229f9fd470145b672e5202308
MinVer: c1bf097a504116b229f9fd470145b672e5202308 e04d1f7a9a8db5f15c4766de0cd9c38aa45f38a5
MinVer: e04d1f7a9a8db5f15c4766de0cd9c38aa45f38a5 4c238f892a969ff49c9da3e93ff2472213fb2590
MinVer: 4c238f892a969ff49c9da3e93ff2472213fb2590 1e36d0fb3c48eba9eebeeb46d213cdb9e473a499
MinVer: 1e36d0fb3c48eba9eebeeb46d213cdb9e473a499 8c4d5f240f5e9e9d2ae44a74be82e42f5dd9ab3e
MinVer: 8c4d5f240f5e9e9d2ae44a74be82e42f5dd9ab3e a18204027d0f4a79432f2c31bbe6c5629e0afa89
MinVer: a18204027d0f4a79432f2c31bbe6c5629e0afa89 7e669b279ba9c80106b50d2a18cadb492ce6da20
MinVer: 7e669b279ba9c80106b50d2a18cadb492ce6da20 defe9d4ecc75f27686a08f62038b1ea5050edc15
MinVer: defe9d4ecc75f27686a08f62038b1ea5050edc15 65b89d4c3a38ba341b6421140a070bd282c367c8
MinVer: 65b89d4c3a38ba341b6421140a070bd282c367c8 bcdc35e58ad93e1634cb4d8949c25db3fa96898c
MinVer: bcdc35e58ad93e1634cb4d8949c25db3fa96898c f7a4e7baea75b88a504880508784222fcded0849
MinVer: f7a4e7baea75b88a504880508784222fcded0849 474a0083aec127510223dc3fc6ee3b96643edf99
MinVer: 474a0083aec127510223dc3fc6ee3b96643edf99 6a7df3e5e0ad97b57a87c0abb569f0564a3c4efb
MinVer: 6a7df3e5e0ad97b57a87c0abb569f0564a3c4efb 5e7240e0adc407ccfae9f5f5a398b177a83cbfb9
MinVer: 5e7240e0adc407ccfae9f5f5a398b177a83cbfb9 ad745b805c6ee57cde3c039136322ee0c345dec8
MinVer: ad745b805c6ee57cde3c039136322ee0c345dec8 b4d6f3301e9c7a7db9bf819fd4bf684062c60a96
MinVer: b4d6f3301e9c7a7db9bf819fd4bf684062c60a96 d138df8c18856269b962b7aecc1e448206495745
MinVer: d138df8c18856269b962b7aecc1e448206495745 26fd6ca82dc840bb10bc831906b5dbbdafb8aa1a
MinVer: 26fd6ca82dc840bb10bc831906b5dbbdafb8aa1a 70222c1758890567f27898bf6d5dc2fe8d7ec763
MinVer: 70222c1758890567f27898bf6d5dc2fe8d7ec763 15402f8f33cc780374c7d2592cf733bbb6790306
MinVer: 15402f8f33cc780374c7d2592cf733bbb6790306 de84330ecee8f611e49f1bf5de19a5b902a5d6ea
MinVer: de84330ecee8f611e49f1bf5de19a5b902a5d6ea 5ef35679d36ea802556424169ebf5b52e1e3d361
MinVer: 5ef35679d36ea802556424169ebf5b52e1e3d361
MinVer: Git stderr:
MinVer:
MinVer: Running Git: git show-ref --tags --dereference
MinVer: Git exit code: 1
MinVer: Git stdout:
MinVer:
MinVer: Git stderr:
MinVer:
MinVer: Checking commit 04a9c05 (height 0)...
MinVer: Found no version tags on commit 04a9c05.
MinVer: Commit 04a9c05 has 1 parent(s):
MinVer: - 499ac00
MinVer: Checking parents of commit 04a9c05...
MinVer: Checking commit 499ac00 (height 1)...
MinVer: Found no version tags on commit 499ac00.
MinVer: Commit 499ac00 has 1 parent(s):
MinVer: - f1e06de
MinVer: Checking parents of commit 499ac00...
MinVer: Checking commit f1e06de (height 2)...
MinVer: Found no version tags on commit f1e06de.
MinVer: Commit f1e06de has 1 parent(s):
MinVer: - 4d4f1da
MinVer: Checking parents of commit f1e06de...
MinVer: Checking commit 4d4f1da (height 3)...
MinVer: Found no version tags on commit 4d4f1da.
MinVer: Commit 4d4f1da has 1 parent(s):
MinVer: - 3799532
MinVer: Checking parents of commit 4d4f1da...
MinVer: Checking commit 3799532 (height 4)...
MinVer: Found no version tags on commit 3799532.
MinVer: Commit 3799532 has 1 parent(s):
MinVer: - c1bf097
MinVer: Checking parents of commit 3799532...
MinVer: Checking commit c1bf097 (height 5)...
MinVer: Found no version tags on commit c1bf097.
MinVer: Commit c1bf097 has 1 parent(s):
MinVer: - e04d1f7
MinVer: Checking parents of commit c1bf097...
MinVer: Checking commit e04d1f7 (height 6)...
MinVer: Found no version tags on commit e04d1f7.
MinVer: Commit e04d1f7 has 1 parent(s):
MinVer: - 4c238f8
MinVer: Checking parents of commit e04d1f7...
MinVer: Checking commit 4c238f8 (height 7)...
MinVer: Found no version tags on commit 4c238f8.
MinVer: Commit 4c238f8 has 1 parent(s):
MinVer: - 1e36d0f
MinVer: Checking parents of commit 4c238f8...
MinVer: Checking commit 1e36d0f (height 8)...
MinVer: Found no version tags on commit 1e36d0f.
MinVer: Commit 1e36d0f has 1 parent(s):
MinVer: - 8c4d5f2
MinVer: Checking parents of commit 1e36d0f...
MinVer: Checking commit 8c4d5f2 (height 9)...
MinVer: Found no version tags on commit 8c4d5f2.
MinVer: Commit 8c4d5f2 has 1 parent(s):
MinVer: - a182040
MinVer: Checking parents of commit 8c4d5f2...
MinVer: Checking commit a182040 (height 10)...
MinVer: Found no version tags on commit a182040.
MinVer: Commit a182040 has 1 parent(s):
MinVer: - 7e669b2
MinVer: Checking parents of commit a182040...
MinVer: Checking commit 7e669b2 (height 11)...
MinVer: Found no version tags on commit 7e669b2.
MinVer: Commit 7e669b2 has 1 parent(s):
MinVer: - defe9d4
MinVer: Checking parents of commit 7e669b2...
MinVer: Checking commit defe9d4 (height 12)...
MinVer: Found no version tags on commit defe9d4.
MinVer: Commit defe9d4 has 1 parent(s):
MinVer: - 65b89d4
MinVer: Checking parents of commit defe9d4...
MinVer: Checking commit 65b89d4 (height 13)...
MinVer: Found no version tags on commit 65b89d4.
MinVer: Commit 65b89d4 has 1 parent(s):
MinVer: - bcdc35e
MinVer: Checking parents of commit 65b89d4...
MinVer: Checking commit bcdc35e (height 14)...
MinVer: Found no version tags on commit bcdc35e.
MinVer: Commit bcdc35e has 1 parent(s):
MinVer: - f7a4e7b
MinVer: Checking parents of commit bcdc35e...
MinVer: Checking commit f7a4e7b (height 15)...
MinVer: Found no version tags on commit f7a4e7b.
MinVer: Commit f7a4e7b has 1 parent(s):
MinVer: - 474a008
MinVer: Checking parents of commit f7a4e7b...
MinVer: Checking commit 474a008 (height 16)...
MinVer: Found no version tags on commit 474a008.
MinVer: Commit 474a008 has 1 parent(s):
MinVer: - 6a7df3e
MinVer: Checking parents of commit 474a008...
MinVer: Checking commit 6a7df3e (height 17)...
MinVer: Found no version tags on commit 6a7df3e.
MinVer: Commit 6a7df3e has 1 parent(s):
MinVer: - 5e7240e
MinVer: Checking parents of commit 6a7df3e...
MinVer: Checking commit 5e7240e (height 18)...
MinVer: Found no version tags on commit 5e7240e.
MinVer: Commit 5e7240e has 1 parent(s):
MinVer: - ad745b8
MinVer: Checking parents of commit 5e7240e...
MinVer: Checking commit ad745b8 (height 19)...
MinVer: Found no version tags on commit ad745b8.
MinVer: Commit ad745b8 has 1 parent(s):
MinVer: - b4d6f33
MinVer: Checking parents of commit ad745b8...
MinVer: Checking commit b4d6f33 (height 20)...
MinVer: Found no version tags on commit b4d6f33.
MinVer: Commit b4d6f33 has 1 parent(s):
MinVer: - d138df8
MinVer: Checking parents of commit b4d6f33...
MinVer: Checking commit d138df8 (height 21)...
MinVer: Found no version tags on commit d138df8.
MinVer: Commit d138df8 has 1 parent(s):
MinVer: - 26fd6ca
MinVer: Checking parents of commit d138df8...
MinVer: Checking commit 26fd6ca (height 22)...
MinVer: Found no version tags on commit 26fd6ca.
MinVer: Commit 26fd6ca has 1 parent(s):
MinVer: - 70222c1
MinVer: Checking parents of commit 26fd6ca...
MinVer: Checking commit 70222c1 (height 23)...
MinVer: Found no version tags on commit 70222c1.
MinVer: Commit 70222c1 has 1 parent(s):
MinVer: - 15402f8
MinVer: Checking parents of commit 70222c1...
MinVer: Checking commit 15402f8 (height 24)...
MinVer: Found no version tags on commit 15402f8.
MinVer: Commit 15402f8 has 1 parent(s):
MinVer: - de84330
MinVer: Checking parents of commit 15402f8...
MinVer: Checking commit de84330 (height 25)...
MinVer: Found no version tags on commit de84330.
MinVer: Commit de84330 has 1 parent(s):
MinVer: - 5ef3567
MinVer: Checking parents of commit de84330...
MinVer: Checking commit 5ef3567 (height 26)...
MinVer: Found no version tags on commit 5ef3567.
MinVer: Found root commit { Commit: 5ef3567, Tag: '', Version: 0.0.0-alpha.0, Height: 26 }.
MinVer: 27 commits checked.
MinVer: No commit found with a valid SemVer 2.0 version. Using default version 0.0.0-alpha.0.
MinVer: Using { Commit: 5ef3567, Tag: '', Version: 0.0.0-alpha.0, Height: 26 }.
MinVer: The calculated version 0.0.0-alpha.0.26 satisfies the minimum major minor 0.0.
MinVer: Calculated version 0.0.0-alpha.0.26.
0.0.0-alpha.0.26

Compared with full log from GitHub:

MinVer: MinVer 5.0.0+e17745c3a16e1b64a4863b4e780ca179b34ac38f.
MinVer: Running Git: git status --short
MinVer: Git exit code: 0
MinVer: Git stdout:
MinVer: ?? .codecov/
MinVer: 
MinVer: Git stderr:
MinVer: 
MinVer: Running Git: git log --pretty=format:"%H %P"
MinVer: Git exit code: 0
MinVer: Git stdout:
MinVer: 5e7240e0adc407ccfae9f5f5a398b177a83cbfb9 ad745b805c6ee57cde3c039136322ee0c345dec8
MinVer: ad745b805c6ee57cde3c039136322ee0c345dec8 b4d6f3301e9c7a7db9bf819fd4bf684062c60a96
MinVer: b4d6f3301e9c7a7db9bf819fd4bf684062c60a96 d138df8c18856269b962b7aecc1e448206495745
MinVer: d138df8c18856269b962b7aecc1e448206495745 26fd6ca82dc840bb10bc831906b5dbbdafb8aa1a
MinVer: 26fd6ca82dc840bb10bc831906b5dbbdafb8aa1a 70222c1758890567f27898bf6d5dc2fe8d7ec763
MinVer: 70222c1758890567f27898bf6d5dc2fe8d7ec763 [15](https://github.com/codebeltnet/shared-kernel/actions/runs/8508680216/job/23310035984#step:6:17)402f8f33cc780374c7d2592cf733bbb6790306
MinVer: 15402f8f33cc780374c7d2592cf733bbb6790306 de84330ecee8f611e49f1bf5de19a5b902a5d6ea
MinVer: de84330ecee8f611e49f1bf5de19a5b902a5d6ea 5ef35679d36ea802556424[16](https://github.com/codebeltnet/shared-kernel/actions/runs/8508680216/job/23310035984#step:6:18)9ebf5b52e1e3d361
MinVer: 5ef35679d36ea802556424169ebf5b52e1e3d361 
MinVer: Git stderr:
MinVer: 
MinVer: Running Git: git show-ref --tags --dereference
MinVer: Git exit code: 1
MinVer: Git stdout:
MinVer: 
MinVer: Git stderr:
MinVer: 
MinVer: Checking commit 5e7240e (height 0)...
MinVer: Found no version tags on commit 5e7240e.
MinVer: Commit 5e7240e has 1 parent(s):
MinVer: - ad745b8
MinVer: Checking parents of commit 5e7240e...
MinVer: Checking commit ad745b8 (height 1)...
MinVer: Found no version tags on commit ad745b8.
MinVer: Commit ad745b8 has 1 parent(s):
MinVer: - b4d6f33
MinVer: Checking parents of commit ad745b8...
MinVer: Checking commit b4d6f33 (height 2)...
MinVer: Found no version tags on commit b4d6f33.
MinVer: Commit b4d6f33 has 1 parent(s):
MinVer: - d138df8
MinVer: Checking parents of commit b4d6f33...
MinVer: Checking commit d138df8 (height 3)...
MinVer: Found no version tags on commit d138df8.
MinVer: Commit d138df8 has 1 parent(s):
MinVer: - 26fd6ca
MinVer: Checking parents of commit d138df8...
MinVer: Checking commit 26fd6ca (height 4)...
MinVer: Found no version tags on commit 26fd6ca.
MinVer: Commit 26fd6ca has 1 parent(s):
MinVer: - 70[22](https://github.com/codebeltnet/shared-kernel/actions/runs/8508680216/job/23310035984#step:6:24)2c1
MinVer: Checking parents of commit 26fd6ca...
MinVer: Checking commit 70222c1 (height 5)...
MinVer: Found no version tags on commit 70222c1.
MinVer: Commit 70222c1 has 1 parent(s):
MinVer: - 15402f8
MinVer: Checking parents of commit 70222c1...
MinVer: Checking commit 15402f8 (height 6)...
MinVer: Found no version tags on commit 15402f8.
MinVer: Commit 15402f8 has 1 parent(s):
MinVer: - de84330
MinVer: Checking parents of commit 15402f8...
MinVer: Checking commit de84330 (height 7)...
MinVer: Found no version tags on commit de84330.
MinVer: Commit de84330 has 1 parent(s):
MinVer: - 5ef3567
MinVer: Checking parents of commit de843[30](https://github.com/codebeltnet/shared-kernel/actions/runs/8508680216/job/23310035984#step:6:32)...
MinVer: Checking commit 5ef3567 (height 8)...
MinVer: Found no version tags on commit 5ef3567.
MinVer: Found root commit *** Commit: 5ef3567, Tag: '', Version: 0.0.0-alpha.0, Height: 8 ***.
MinVer: 9 commits checked.
MinVer: No commit found with a valid SemVer 2.0 version. Using default version 0.0.0-alpha.0.
MinVer: Using *** Commit: 5ef[35](https://github.com/codebeltnet/shared-kernel/actions/runs/8508680216/job/23310035984#step:6:37)67, Tag: '', Version: 0.0.0-alpha.0, Height: 8 ***.
MinVer: The calculated version 0.0.0-alpha.0.8 satisfies the minimum major minor 0.0.
MinVer: Calculated version 0.0.0-alpha.0.8.
gimlichael commented 3 months ago

There's probably something different between the local and GHA working directories. The first thing I would do is turn the verbosity up to trace so you can see exactly how MinVer is arriving at the two different heights.

Even with the differences - if i do a gh repo clone codebeltnet/shared-kernel everything works as expected (or as close to expected as possible).

I still dont get the commit id deviation .. I also tried resetting main with my local copy .. still same issue. I will continue digging, but I am blindfolded :-)

gimlichael commented 3 months ago

And just to add; i have been using your tool in AzDO pipelines for years .. only GitHub Actions proves a greater challenge than expected. Oddly enough - I am not successful in finding minver integrations .. but that could of course just be my Google skills that are lacking ;-)

gimlichael commented 3 months ago

Tags are not read .. even with both fetch-depth set to 0 as well as fetch-tags set to true.

Here is a new dump:

MinVer: MinVer 5.0.0+e17745c3a16e1b64a4863b4e780ca179b34ac38f.
MinVer: Running Git: git status --short
MinVer: Git exit code: 0
MinVer: Git stdout:
MinVer: ?? .codecov/
MinVer: 
MinVer: Git stderr:
MinVer: 
MinVer: Running Git: git log --pretty=format:"%H %P"
MinVer: Git exit code: 0
MinVer: Git stdout:
MinVer: 5e7240e0adc407ccfae9f5f5a398b177a83cbfb9 ad745b805c6ee57cde3c039136322ee0c345dec8
MinVer: ad745b805c6ee57cde3c039136322ee0c345dec8 b4d6f3301e9c7a7db9bf819fd4bf684062c60a96
MinVer: b4d6f3301e9c7a7db9bf819fd4bf684062c60a96 d138df8c18856269b962b7aecc1e448206495745
MinVer: d138df8c18856269b962b7aecc1e448206495745 26fd6ca82dc840bb10bc831906b5dbbdafb8aa1a
MinVer: 26fd6ca82dc840bb10bc831906b5dbbdafb8aa1a 70222c1758890567f27898bf6d5dc2fe8d7ec763
MinVer: 70222c1758890567f27898bf6d5dc2fe8d7ec763 [15](https://github.com/codebeltnet/shared-kernel/actions/runs/8513330606/job/23318141282#step:6:17)402f8f33cc780374c7d2592cf733bbb6790306
MinVer: 15402f8f33cc780374c7d2592cf733bbb6790306 de84330ecee8f611e49f1bf5de19a5b902a5d6ea
MinVer: de84330ecee8f611e49f1bf5de19a5b902a5d6ea 5ef35679d36ea802556424[16](https://github.com/codebeltnet/shared-kernel/actions/runs/8513330606/job/23318141282#step:6:18)9ebf5b52e1e3d361
MinVer: 5ef35679d36ea802556424169ebf5b52e1e3d361 
MinVer: Git stderr:
MinVer: 
MinVer: Running Git: git show-ref --tags --dereference
MinVer: Git exit code: 0
MinVer: Git stdout:
MinVer: d73e7dac80ba1648d0006247067ecb2544eeb3dc refs/tags/0.1.0
MinVer: 
MinVer: Git stderr:
MinVer: 
MinVer: Checking commit 5e7240e (height 0)...
MinVer: Found no version tags on commit 5e7240e.
MinVer: Commit 5e7240e has 1 parent(s):
MinVer: - ad745b8
MinVer: Checking parents of commit 5e7240e...
MinVer: Checking commit ad745b8 (height 1)...
MinVer: Found no version tags on commit ad745b8.
MinVer: Commit ad745b8 has 1 parent(s):
MinVer: - b4d6f33
MinVer: Checking parents of commit ad745b8...
MinVer: Checking commit b4d6f33 (height 2)...
MinVer: Found no version tags on commit b4d6f33.
MinVer: Commit b4d6f33 has 1 parent(s):
MinVer: - d138df8
MinVer: Checking parents of commit b4d6f33...
MinVer: Checking commit d138df8 (height 3)...
MinVer: Found no version tags on commit d138df8.
MinVer: Commit d138df8 has 1 parent(s):
MinVer: - 26fd6ca
MinVer: Checking parents of commit d138df8...
MinVer: Checking commit 26fd6ca (height 4)...
MinVer: Found no version tags on commit 26fd6ca.
MinVer: Commit 26fd6ca has 1 parent(s):
MinVer: - 70[22](https://github.com/codebeltnet/shared-kernel/actions/runs/8513330606/job/23318141282#step:6:24)2c1
MinVer: Checking parents of commit 26fd6ca...
MinVer: Checking commit 70222c1 (height 5)...
MinVer: Found no version tags on commit 70222c1.
MinVer: Commit 70222c1 has 1 parent(s):
MinVer: - 15402f8
MinVer: Checking parents of commit 70222c1...
MinVer: Checking commit 15402f8 (height 6)...
MinVer: Found no version tags on commit 15402f8.
MinVer: Commit 15402f8 has 1 parent(s):
MinVer: - de84330
MinVer: Checking parents of commit 15402f8...
MinVer: Checking commit de84330 (height 7)...
MinVer: Found no version tags on commit de84330.
MinVer: Commit de84330 has 1 parent(s):
MinVer: - 5ef3567
MinVer: Checking parents of commit de843[30](https://github.com/codebeltnet/shared-kernel/actions/runs/8513330606/job/23318141282#step:6:32)...
MinVer: Checking commit 5ef3567 (height 8)...
MinVer: Found no version tags on commit 5ef3567.
MinVer: Found root commit *** Commit: 5ef3567, Tag: '', Version: 0.0.0-alpha.0, Height: 8 ***.
MinVer: 9 commits checked.
MinVer: No commit found with a valid SemVer 2.0 version. Using default version 0.0.0-alpha.0.
MinVer: Using *** Commit: 5ef[35](https://github.com/codebeltnet/shared-kernel/actions/runs/8513330606/job/23318141282#step:6:37)67, Tag: '', Version: 0.0.0-alpha.0, Height: 8 ***.
MinVer: Ignoring height.
MinVer: The calculated version 0.0.0-alpha.0 satisfies the minimum major minor 0.0.
MinVer: Calculated version 0.0.0-alpha.0.
adamralph commented 3 months ago

As you can see from the logs, the head commit is 5e7240e (29th March), which is way down in your history, and is indeed at a height of 8 from 5ef3567 (27th March), which is your first commit.

There is a 0.1.0 tag on commit d73e7d (1st April) but that appears much more recently than the head commit, so it's obviously not in the history, and therefore MinVer doesn't see it.

I see no problem with MinVer here. It seems to be working as expected. The problem seems to be with your working directory. You are expecting the head commit to be somewhere around 7de6c7 (1st April). It seems your local working directory does have its head commit where you expect, but your working directory in GitHub Actions seems to be stuck on commit 5e7240e (29th March) for some reason.

As an observation, I see you are wrapping stock actions such actions/checkout in your own composite actions and using those with floating versions (e.g. @main). I would recommend using the checkout action directly to see if the problem goes away, and with a fixed version for reproducibility, e.g. actions/checkout@v4.1.1.

adamralph commented 3 months ago

And just to add; i have been using your tool in AzDO pipelines for years .. only GitHub Actions proves a greater challenge than expected. Oddly enough - I am not successful in finding minver integrations .. but that could of course just be my Google skills that are lacking ;-)

I don't really understand which MinVer integrations are required.

For .NET SDK projects, you can install the MinVer package.

For other uses, you can execute:

dotnet tool install --global minver-cli --version 5.0.0
minver
adamralph commented 3 months ago

It seems like there isn't a bug in MinVer here so I'm moving this to a discussion, in case anyone can help out with your working directory problems.