adamralph / minver

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

Tags ignored with actions/checkout@v3 #858

Closed nspyke closed 1 year ago

nspyke commented 1 year ago

Version(s)

4.3.0

To reproduce

jobs:
  build:
    name: Build
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Restore
        run: |
          dotnet tool restore
      - name: Version
        id: version
        run: |
          dotnet minver --verbosity trace

Expected behaviour

Works the same as actions/checkout@v2

Actual behaviour

MinVer: 112 commits checked.
MinVer: Ignoring { Commit: e1e1b31, Tag: '', Version: 0.0.0-alpha.0, Height: 86 }.
MinVer: No commit found with a valid SemVer 2.0 version. Using default version 0.0.0-alpha.0.
MinVer: Using    { Commit: 4dfec7e, Tag: '', Version: 0.0.0-alpha.0, Height: 85 }.
MinVer: The calculated version 0.0.0-alpha.0.85 satisfies the minimum major minor 0.0.
MinVer: Calculated version 0.0.0-alpha.0.85.
0.0.0-alpha.0.85

Workarounds

Use deprecated actions/checkout@v2 Output from same repository using v2

MinVer: 3 commits checked.
MinVer: Using { Commit: 45440b9, Tag: '0.2.0', Version: 0.2.0, Height: 1 }.
MinVer: The calculated version 0.2.1-alpha.0.1 satisfies the minimum major minor 0.0.
MinVer: Calculated version 0.2.1-alpha.0.1.
0.2.1-alpha.0.1

Additional context

Add any other context about the problem here.

adamralph commented 1 year ago

I've been using v3 for some time without issue — https://github.com/adamralph/simple-exec/blob/1bff9d403e371677174a49ead73fa818a581a8cd/.github/workflows/ci.yml#L30

adamralph commented 1 year ago

As per my previous comment, I've been using actions/checkout@v3.3.0 for some time and it seems fine. But if there is any problem with a version of actions/checkout not checking out tags, it's not a problem with that action, and not with MinVer. I.e. if the tags are there, MinVer will work. MinVer cannot control the behaviour of actions/checkout.