Skip to content

Commit

Permalink
feat: Delete tag (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrink authored Jun 13, 2021
1 parent da994eb commit c4ff536
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{md,yml}]
indent_style = space
indent_size = 2
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2021 > LIMITED and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Delete Tag

A GitHub Action that deletes the tag that triggered the workflow.

```
pr-mpt/actions-delete-tag@v1
```

## Inputs

No inputs.

## Outputs

No outputs.

## Example

When a new tag is created, assert that the commit has a `dist` directory and if
it does not then delete the tag.

```yaml
name: "Limit Tags To Distributable Commits"

on:
push:
tags:
- "**"

jobs:
validate-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pr-mpt/actions-assert@v2
with:
assertion: npm://@assertions/directory-exists
expected: dist
- if: failure()
name: Delete tag
uses: pr-mpt/actions-delete-tag@v1
```
11 changes: 11 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: "Delete Tag"
description: "Delete the tag that triggered the workflow"
branding:
icon: "trash"
color: "red"
runs:
using: "composite"
steps:
- name: Delete tag
shell: bash
run: git push --delete origin ${{ github.event.ref }}

0 comments on commit c4ff536

Please sign in to comment.