Giter Club home page Giter Club logo

Comments (11)

chrisjohnson00 avatar chrisjohnson00 commented on August 27, 2024 2

I've encountered this as well, i started creating v0.0.0 releases every time i create a new repo

from github-tag-action.

fcarrascosa avatar fcarrascosa commented on August 27, 2024 2

Yup, you understood perfectly :) Ok! Will work on that

from github-tag-action.

fcarrascosa avatar fcarrascosa commented on August 27, 2024 1

Hey @mathieudutour would you mind if I take this and make a PR for it during this week?

from github-tag-action.

chrisjohnson00 avatar chrisjohnson00 commented on August 27, 2024 1

So, this action already assumed the prior tag to be 0.0.0 when there is no tag in the repo.
I have a no-code fix for this that I've implemented on some private repos:

I'd like the initial release for the repo to be v1.0.0 so I've set this up to calculate the default_bump in a prior step based on if there's a tag or not. The actions-ecosystem/action-get-latest-tag action defaults to v0.0.0 when there is no tag, so based on this I'm setting the default_bump to be major. If you want it to be 0.1.0, just set it to minor.

If you choose to set default_bump to false, then clearly this won't work.

    steps:
      - uses: 'actions/[email protected]'
        with:
          fetch-depth: 0
      - name: 'Action Get Latest Tag'
        uses: 'actions-ecosystem/[email protected]'
        id: 'get-latest-tag'
        with:
          semver_only: true
      - name: 'Determine default bump'
        id: 'bump'
        run: |
          LATEST_TAG=${{ steps.get-latest-tag.outputs.tag }}
          if [ "$LATEST_TAG" = "v0.0.0" ]; then
              echo "::set-output name=type::major"
          else
              echo "::set-output name=type::patch"
          fi
      - name: 'Bump version and push tag'
        id: 'tag_version'
        uses: 'mathieudutour/[email protected]'
        with:
          github_token: '${{ secrets.REPO_ONLY }}'
          release_branches: 'main'
          default_bump: '${{ steps.bump.outputs.type }}'

from github-tag-action.

onwsk8r avatar onwsk8r commented on August 27, 2024

I've gotten 0.0.1 on repos with no tags using v5 of this action

from github-tag-action.

fcarrascosa avatar fcarrascosa commented on August 27, 2024

I've encountered this as well, i started creating v0.0.0 releases every time i create a new repo

That's exactly what I ended up doing...

from github-tag-action.

mathieudutour avatar mathieudutour commented on August 27, 2024

yeah I'd be more than happy to review a PR :)

from github-tag-action.

fcarrascosa avatar fcarrascosa commented on August 27, 2024

I started working on this and I could isolate the case where this is happenning: default_bump set to 'false', it should probably create tag v0.0.0 or the correspoding semver tag for the commits.

from github-tag-action.

fcarrascosa avatar fcarrascosa commented on August 27, 2024

So, here's my question for you @mathieudutour, should the script automatically create the tag 0.0.0 or a tag based on the commits the user just pushed?

from github-tag-action.

mathieudutour avatar mathieudutour commented on August 27, 2024

Not sure I understand exactly but I'd say the script should assume the previous tag was 0.0.0 if there wasn't any before, and generate the real one based on the commits (and bump relatively to 0.0.0).

from github-tag-action.

TurtleTT avatar TurtleTT commented on August 27, 2024

Is there an updated for this issue?

from github-tag-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.