forked from olegtarasov/get-tag
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
068d01c
commit c0eaaac
Showing
4 changed files
with
44 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
# Get tag name | ||
|
||
This simple action gets tag name from commit that triggered the action and puts it into an environment variable GITHUB_TAG_NAME. It will also export is as an output | ||
named "tag". | ||
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: | ||
|
||
```yaml | ||
steps: | ||
- uses: olegtarasov/get-tag@v1 | ||
- uses: olegtarasov/get-tag@v2 | ||
id: tagName | ||
- name: Some other step | ||
with: | ||
tagname: ${{ steps.tagName.outputs.tag }} | ||
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters