Skip to content
/ get-tag Public
forked from olegtarasov/get-tag

A GitHub action that gets current tag name and puts it into an environment variable

License

Notifications You must be signed in to change notification settings

scraye/get-tag

 
 

Repository files navigation

Get tag name

This action gets tag name from commit that triggered the action and puts it into an environment variable GIT_TAG_NAME. It will also export is as an output named "tag".

You can also use optional parameters tagRegex and tagRegexGroup to extract a part from tag string.

Usage

Dead simple:

    steps:
      - uses: olegtarasov/get-tag@v2
        id: tagName
        with:
          tagRegex: "foobar-(.*)"  # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined.
          tagRegexGroup: 1 # Optional. Default is 1.
      - name: Some other step # Output usage example
        with:
          tagname: ${{ steps.tagName.outputs.tag }}
      - name: Yet another step # Environment variabl usage example
        run: |
          docker build . --file Dockerfile --tag docker.pkg.github.com/someimage:$GIT_TAG_NAME

About

A GitHub action that gets current tag name and puts it into an environment variable

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 70.9%
  • TypeScript 29.1%