autotag/examples/regex.md

31 lines
617 B
Markdown
Raw Normal View History

2020-09-11 03:32:19 +07:00
# Regex Strategy
The regex strategy uses the pattern identified at `regex_pattern` on the file identified by `root` to determine the version.
**.gorc**
```sh
version: 1.1.0
```
**.github/workflows/example.yml**
```yaml
name: Release New Version
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2020-09-11 10:15:14 +07:00
- uses: butlerlogic/action-autotag@master
2020-09-11 03:32:19 +07:00
with:
2020-09-11 10:15:14 +07:00
regex_pattern: "(version:)(\\s)?(?<version>\\d+\\.\\d+\\.\\d+(.+)?)\\n?"
2020-09-11 03:32:19 +07:00
root: ./.gorc
tag_prefix: "v"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
```