Example to trigger only on new tag

This commit is contained in:
CrazyMax 2020-01-20 18:47:42 +01:00
parent 58fb585edd
commit 53acad1bef
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
1 changed files with 25 additions and 1 deletions

View File

@ -52,7 +52,31 @@ jobs:
> **IMPORTANT**: note the `Unshallow` step. It is required for the changelog to work correctly. > **IMPORTANT**: note the `Unshallow` step. It is required for the changelog to work correctly.
> If you want to run GoReleaser only on new tag, check [this comment](https://github.com/goreleaser/goreleaser-action/issues/61#issuecomment-569286582). If you want to run GoReleaser only on new tag, you can use this event:
```yaml
on:
push:
tags:
- '*'
```
Or with a condition on GoReleaser step:
```yaml
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
key: ${{ secrets.YOUR_PRIVATE_KEY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
> For detailed instructions please follow GitHub Actions [workflow syntax][syntax].
## Customizing ## Customizing