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

semver based on branch names #98

Open
devinrsmith opened this issue May 28, 2021 · 2 comments
Open

semver based on branch names #98

devinrsmith opened this issue May 28, 2021 · 2 comments

Comments

@devinrsmith
Copy link

I'd like to kick off semver tags based on git branch names, as opposed to git tag names.

For example:

push refs/heads/release/v1.2.3 1.2.3, 1.2

It doesn't seem like this is possible with type=semver since that only works on git tags. type=pattern likewise doesn't apply. type=ref,event=branch, while applying to branches, doesn't allow custom patterns.

Any help would be much appreciated!

@devinrsmith
Copy link
Author

I've got a hacky workaround that looks something like this:

      - name: Get Semver
        id: semver
        if: ${{ startsWith(github.ref, 'refs/heads/release/v') }}
        run: |
          semver=$(echo ${{ github.ref }} | tail -c +21)
          echo "::set-output name=semver::$semver"
          
...
          
            type=raw,enable=${{ startsWith(github.ref, 'refs/heads/release/v') }},value=${{ steps.semver.outputs.semver }}

@crazy-max
Copy link
Member

@devinrsmith That could be done through type=match def but it's only supported for tags atm. Maybe also with #56.

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

2 participants