GitHub Action
tag-protector
v1
Latest version
A GitHub Action that deletes the tag if a tag that doesn't follow the rule is pushed. If you release with tag push, there might be many tags that didn't trigger the release workflow and kind of make your repo messy.
You can also select wether as tag push of malform format will fail the workflow or not.
This action extract the number from a pull request which has triggered this by default. You don't need to specify the pull request number by ${{ github.event.pull_request.number }}
.
- name: Reject tags
uses: KeisukeYamashita/tag-protector@v1
rule: v[0-9]{1,}.[0-9]{1,}-[0-9]{1,}
This is just an example to show one way in which this action can be used.
on: pull_request
jobs:
auto-merge:
- name: Reject tags
uses: KeisukeYamashita/tag-protector@v1
with:
rule: v[0-9]{1,}.[0-9]{1,}-[0-9]{1,}
Name | Description | Default |
---|---|---|
deleteTag |
Delete the tag that doesn't follow the rule or not' | true |
rule |
Regex of the tag format should be | -(Required) |
failWorkflow |
Failed the workflow or not | false |
repostiory |
The GitHub repository containing the pull request | Current repository |
token |
GITHUB_TOKEN or a repo scoped PAT. |
GITHUB_TOKEN |
Name | Description |
---|---|
ref |
Tag. It doesn't contain /ref/tags prefix. |