Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
xrkffgg committed Feb 18, 2021
1 parent d332a63 commit b39d00b
Show file tree
Hide file tree
Showing 6 changed files with 7,060 additions and 62 deletions.
Empty file added CHANGELOG.md
Empty file.
83 changes: 52 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,61 @@
<p align="center">
<a href="">
<img width="140" src="https://avatars.githubusercontent.com/u/73879334?s=200&v=4" />
</a>
</p>

<h1 align="center">Action JavaScript Template</h1>
<div align="center">
A simple javascript template for rapid development of GitHub actions.
</div>

![CI](https://github.com/actions-cool/action-js-template/workflows/CI/badge.svg)

## 🚀 How to use?
# 📌 Maintain One Comment

Maintain just one comment in Issue and PR.

- This Action is only applicable to triggers related to issue and pull_request
- When the **filtered comments** do not exist, will add a comment
- When the **filtered comments** is only one, this comment will be updated
- When the number of **filtered comments** exceeds 1, no operation will be performed

## How to use?
```yml
name: Maintain One Comment

on: [issues, pull_request]

jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: maintain-comment
uses: actions-cool/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Hi 😀
<!-- Created by actions-cool/maintain-one-comment -->
emojis: '+1, laugh'
body-include: '<!-- Created by actions-cool/maintain-one-comment -->'
```
![](https://github.com/actions-cool/resources/blob/main/image/template-js.png?raw=true)
| Name | Desc | Type | Required |
| -- | -- | -- | -- |
| token | GitHub token | string | ✖ |
| body | Create comment body | string | ✔ |
| emojis | Add [emoji](#emoji-list) | string | ✖ |
| update-mode | Comment update mode. Options: `replace` `append`. Default: `replace` | string | ✖ |
| comment-auth | Filter comment auth | string | ✖ |
| body-include | Filter comment body | string | ✖ |

## 📒 Catalog Introduction
## Emoji List

```
├── .github/workflows/ The CI for make sure it is packaged correctly
├── dist Package the generated Aciton execution code
├── src Component home directory
│ └── main.js Your code
└── action.yml Action config
```
| input | emoji |
| -- | -- |
| `+1` | 👍 |
| `-1` | 👎 |
| `laugh` | 😄 |
| `confused` | 😕 |
| `heart` | ❤️ |
| `hooray` | 🎉 |
| `rocket` | 🚀 |
| `eyes` | 👀 |

The rest of the documents can be consulted by yourself.
## Changelog

## 🤖 Command introduction
[CHANGELOG](./CHANGELOG.md)

| Name | Desc |
| -- | -- |
| package | action build for release |
| format | prettier write |
| format-check | prettier check |
## 💖 Who is using?

## LICENSE

[MIT](https://github.com/actions-cool/action-js-template/blob/main/LICENSE)
[MIT](./LICENSE)
17 changes: 12 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions
name: 'Maintain One Comment'
description: 'A simple javascript template for rapid development of GitHub actions.'
description: 'Maintain just one comment in Issue and PR.'
author: 'xrkffgg'

branding:
Expand All @@ -14,10 +14,17 @@ inputs:
description: Secret GitHub API token to use for making API requests.
default: ${{ github.token }}
required: true

#outputs:
# result:
# description: action result
body:
description: Comment content.
required: true
emojis:
description: Add emojis to comment.
update-mode:
description: Update comment mode. Default replace. Option append.
comment-auth:
description: Comment auth filter.
body-include:
description: Comment body filter.

runs:
using: 'node12'
Expand Down
Loading

0 comments on commit b39d00b

Please sign in to comment.