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

Is there a way to get only the major version #11

Open
MurrayJack opened this issue Jun 28, 2021 · 2 comments
Open

Is there a way to get only the major version #11

MurrayJack opened this issue Jun 28, 2021 · 2 comments

Comments

@MurrayJack
Copy link

Hello! thanks for this project!

I was wondering if there is a way to get only the major version from this?

@martinbeentjes
Copy link
Owner

Currently, no. But with some regular expressions this is certainly possible. You can an step in your workflow with a little bit of shell script to get the major version and return that as output of that step.

@karlludwigweise
Copy link

I'm currently using this step to generate my versions based on this action:

      - name: Generate addition version tags
        id: versions
        run: |
          echo "major=$(cut -d '.' -f 1 <<< ${{ steps.package-json-version.outputs.current-version}})" >> $GITHUB_OUTPUT
          echo "minor=$(cut -d '.' -f 1,2 <<< ${{ steps.package-json-version.outputs.current-version}})" >> $GITHUB_OUTPUT
          echo "full=${{ steps.package-json-version.outputs.current-version}}" >> $GITHUB_OUTPUT

To be accessed with ${{ steps.versions.outputs.major}}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants