Skip to content

strip the prefix for github.ref (refs/heads) #86

Open
@xavierchow

Description

@xavierchow

I have a case that in the staging environment we are not using the tags but a release-candidate branch, so I'm expecting to have a release candidate branch name as the version.
I noticed that only the refs/tags/ is stripped, so when setting version with ${{ github.ref }} it complains the slashes are not permitted.

I'm wondering if we can enhance the following regex process to allow strip the prefix for refs/heads as well?

// If the users passes in `${{github.ref}}, then it will have an unwanted prefix.
version = versionOption.replace(/^(refs\/tags\/)/, '');

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions