https://github.com/flaticols/tagger
Creating a new release using the labels from the Pull Requests
https://github.com/flaticols/tagger
action actions automation releases tags
Last synced: 6 months ago
JSON representation
Creating a new release using the labels from the Pull Requests
- Host: GitHub
- URL: https://github.com/flaticols/tagger
- Owner: flaticols
- License: mit
- Created: 2022-11-26T23:03:14.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-05T08:55:55.000Z (about 2 years ago)
- Last Synced: 2025-03-29T05:38:24.621Z (6 months ago)
- Topics: action, actions, automation, releases, tags
- Language: Go
- Homepage: https://github.com/flaticols/tagger
- Size: 2.01 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Tagger 0.8
Creating a new release using the labels from the Pull Requests
## 🚀 How to use
Add a one of `major`, `minor` or `path` label to your PR and merge it.
- **Major** - reset `minor` and `patch`
- **Minor** - reset `patch`**Examples**
##### Just add `patch` label to PR:
With default settings you will get release: v0.0.1##### Add `patch` and I have latest tag `v0.4.10`
Result: release with tag and name `v0.4.11`##### Add `Minor` and I have latest tag `v0.4.10`
Result: release with tag and name `v0.5.0`##### Add `Major` and I have latest tag `v0.4.10`
Result: release with tag and name `v1.0.0`### First run
#### Labels
There are 3 labels will be created or updated (comply with [semver](https://semver.org)):
- Major
- Minor
- Patch#### Tags
If your repository does not contain any tags, the next one after the `default_tag` will be created:
Default: `v0.0.0` -> first tag `v0.0.1`
### inputs
- `github-token` - GitHub Token. Default `${{ github.token }}`
- `pr-number` - GitHub Token. Default `${{ github.event.number }}`
- `default-tag` - GitHub Token. Default `0.0.0`
- `prefix` - Tag prefix. Default `v`### Add new GitHub Action Workflow file:
```yaml
name: 'Release'on:
pull_request:
types: [closed]jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: flaticols/tagger@v1.0.0
```### Override inputs:
```yaml
name: 'Release'on:
pull_request:
types: [closed]jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
github-token: 'My token'
pr-number: 10
default-tag: '0.1.0'
prefix: "ver"
- uses: flaticols/tagger@v1.0.0
```### Run locally
```bash
go run . create -o flaticols -r tagger -t $(gh auth token)
```### Use as package (with cobra only)
```go
package mainimport C "github.com/flaticols/tagger/commands"
func main() {
root := cobra.Command{}root.AddCommand(C.CreateCommand())
_, err := root.ExecuteC()
if err != nil {
return
}
}```