Compare commits

..

17 Commits

Author SHA1 Message Date
元凛
65840f57fe chore: update dist 2023-02-06 21:51:50 +08:00
元凛
dbeaa215cb style: update style & changelog 2023-02-06 21:47:17 +08:00
Wuxh
6a55b3a9f4 feat: add toggle-labels action (#132)
* feat: add `toggle-labels` action

* docs: update docs

* chore: npm run package

* Revert "docs: update docs"

This reverts commit b08e8f300e.

* docs: update docs

* Update README.zh-CN.md

Co-authored-by: xrkffgg <xrkffgg@vip.qq.com>

* Update README.md

Co-authored-by: xrkffgg <xrkffgg@vip.qq.com>

* Update README.zh-CN.md

Co-authored-by: xrkffgg <xrkffgg@vip.qq.com>

* Update README.md

* move

* update

* lint code

* build

use npm run all

* update

* build

use npm run all

* chore: order

* update docs

* format code

use npm run format

* build

use npm run all

---------

Co-authored-by: xrkffgg <xrkffgg@vip.qq.com>
2023-01-31 12:56:43 +08:00
xrkffgg
f4eba4debf docs: update badge 2022-12-21 20:35:47 +08:00
xrkffgg
09bc8811a0 docs: up badge 2022-12-21 20:34:35 +08:00
元凛
dfac87c369 chore: update tag 2022-11-13 01:15:25 +08:00
元凛
275328970d chore: update changelog & dist 2022-11-13 01:09:48 +08:00
John Knowles
d51658accd fix: null body case (#129) 2022-11-13 01:05:56 +08:00
miracles1919
12b5247afc docs: add user antd-mobile (#127) 2022-10-28 10:44:16 +08:00
元凛
02811b26b6 docs: update changelog 2022-10-21 15:21:48 +08:00
Ing
a72c4f551c fix #124 (#125)
* fix #124

* update actions/core@^1.10.0

* revert dist/index.js

* update dist/index.js
2022-10-21 14:56:44 +08:00
元凛
e17a3a158c chore: update release script 2022-10-19 21:14:06 +08:00
元凛
3826e864ab docs: update users 2022-10-19 21:12:17 +08:00
xrkffgg
1cb0eedfea fix: body null (#123)
* fix: body null

* docs: update changelog
2022-10-19 21:10:24 +08:00
元凛
7f09991212 docs: add user electron 2022-09-23 16:21:13 +08:00
Alexandre Burgoni
cde2648b72 docs: update find-issues reference (#117)
* chore: update find-issue section

* chore: update find-isssues reference
2022-09-16 10:04:09 +08:00
元凛
405d4bd782 style: remove empty 2022-09-02 17:15:00 +08:00
18 changed files with 1929 additions and 187 deletions

View File

@@ -7,6 +7,30 @@
🛠 refactor 🛠 refactor
--> -->
## v3.4.0
`2023.02.06`
- 🚀 feat: support `toggle-labels`. [#132](https://github.com/actions-cool/issues-helper/pull/132) [@Wxh16144](https://github.com/Wxh16144)
## v3.3.3
`2022.11.13`
- 🐞 fix: body null case. [#129](https://github.com/actions-cool/issues-helper/pull/129) [@madmansn0w](https://github.com/madmansn0w)
## v3.3.2
`2022.10.21`
- 💄 chore: update `@actions/core` version. [#125](https://github.com/actions-cool/issues-helper/pull/125) [@wjz304](https://github.com/wjz304)
## v3.3.1
`2022.10.19`
- 🐞 fix: body null case. [#123](https://github.com/actions-cool/issues-helper/pull/123)
## v3.3.0 ## v3.3.0
`2022.09.02` `2022.09.02`

122
README.md
View File

@@ -10,7 +10,7 @@
A GitHub Action that easily helps you automatically manage issues A GitHub Action that easily helps you automatically manage issues
[![](https://img.shields.io/github/workflow/status/actions-cool/issues-helper/ci?style=flat-square)](https://github.com/actions-cool/issues-helper/actions) [![](https://img.shields.io/github/actions/workflow/status/actions-cool/issues-helper/ci.yml?branch=main&style=flat-square)](https://github.com/actions-cool/issues-helper/actions)
[![](https://img.shields.io/badge/marketplace-issues--helper-red?style=flat-square)](https://github.com/marketplace/actions/issues-helper) [![](https://img.shields.io/badge/marketplace-issues--helper-red?style=flat-square)](https://github.com/marketplace/actions/issues-helper)
![](https://img.shields.io/github/languages/top/actions-cool/issues-helper?color=%2308979c&style=flat-square) ![](https://img.shields.io/github/languages/top/actions-cool/issues-helper?color=%2308979c&style=flat-square)
[![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi)
@@ -56,32 +56,49 @@ Please leave a message at [**here**](https://github.com/actions-cool/issues-help
</a> </a>
</td> </td>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/vueComponent/ant-design-vue"> <a href="https://github.com/ant-design/ant-design-mobile">
<img src="https://avatars1.githubusercontent.com/u/32120805?s=200&v=4" width="46"/> <img src="https://gw.alipayobjects.com/zos/bmw-prod/b874caa9-4458-412a-9ac6-a61486180a62.svg" width="46"/>
</a> </a>
</td> </td>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/twbs/bootstrap"> <a href="https://github.com/vueComponent/ant-design-vue">
<img src="https://getbootstrap.com/docs/5.1/assets/brand/bootstrap-logo-shadow.png" width="46"/> <img src="https://avatars1.githubusercontent.com/u/32120805?s=200&v=4" width="46"/>
</a> </a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td align="center" width="180"><a href="https://github.com/ant-design/ant-design">ant-design</a></td> <td align="center" width="180"><a href="https://github.com/ant-design/ant-design">ant-design</a></td>
<td align="center" width="180"><a href="https://github.com/ant-design-blazor/ant-design-blazor">ant-design-blazor</a></td> <td align="center" width="180"><a href="https://github.com/ant-design-blazor/ant-design-blazor">ant-design-blazor</a></td>
<td align="center" width="180"><a href="https://github.com/ant-design/ant-design-mobile">ant-design-mobile</a></td>
<td align="center" width="180"><a href="https://github.com/vueComponent/ant-design-vue">ant-design-vue</a></td> <td align="center" width="180"><a href="https://github.com/vueComponent/ant-design-vue">ant-design-vue</a></td>
<td align="center" width="180"><a href="https://github.com/twbs/bootstrap">bootstrap</a></td>
</tr><tr> </tr><tr>
<td align="center" width="180">
<a href="https://github.com/twbs/bootstrap">
<img src="https://getbootstrap.com/docs/5.1/assets/brand/bootstrap-logo-shadow.png" width="46"/>
</a>
</td>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/umijs/dumi"> <a href="https://github.com/umijs/dumi">
<img src="https://avatars1.githubusercontent.com/u/33895495?s=200&v=4" width="46"/> <img src="https://avatars1.githubusercontent.com/u/33895495?s=200&v=4" width="46"/>
</a> </a>
</td> </td>
<td align="center" width="180">
<a href="https://github.com/electron/electron">
<img src="https://avatars.githubusercontent.com/u/13409222?s=200&v=4" width="46"/>
</a>
</td>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/element-plus/element-plus"> <a href="https://github.com/element-plus/element-plus">
<img src="https://avatars.githubusercontent.com/u/68583457" width="46"/> <img src="https://avatars.githubusercontent.com/u/68583457" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/twbs/bootstrap">bootstrap</a></td>
<td align="center" width="180"><a href="https://github.com/umijs/dumi">dumi</a></td>
<td align="center" width="180"><a href="https://github.com/electron/electron">electron</a></td>
<td align="center" width="180"><a href="https://github.com/element-plus/element-plus">element-plus</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/alibaba/formily"> <a href="https://github.com/alibaba/formily">
<img src="https://img.alicdn.com/imgextra/i2/O1CN01Kq3OHU1fph6LGqjIz_!!6000000004056-55-tps-1141-150.svg" width=""/> <img src="https://img.alicdn.com/imgextra/i2/O1CN01Kq3OHU1fph6LGqjIz_!!6000000004056-55-tps-1141-150.svg" width=""/>
@@ -92,13 +109,6 @@ Please leave a message at [**here**](https://github.com/actions-cool/issues-help
<img src="https://avatars.githubusercontent.com/u/6128107?s=200&v=4" width="46"/> <img src="https://avatars.githubusercontent.com/u/6128107?s=200&v=4" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/umijs/dumi">dumi</a></td>
<td align="center" width="180"><a href="https://github.com/element-plus/element-plus">element-plus</a></td>
<td align="center" width="180"><a href="https://github.com/alibaba/formily">formily</a></td>
<td align="center" width="180"><a href="https://github.com/vuejs/jsx-next">jsx-next</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/mui/material-ui"> <a href="https://github.com/mui/material-ui">
<img src="https://avatars.githubusercontent.com/u/33663932?s=200&v=4" width="46"/> <img src="https://avatars.githubusercontent.com/u/33663932?s=200&v=4" width="46"/>
@@ -109,6 +119,13 @@ Please leave a message at [**here**](https://github.com/actions-cool/issues-help
<img src="https://camo.githubusercontent.com/b8ebecade711b9ae1fa306e7a1c9dd680fb56b0e2b9f015fec9cbad343570353/68747470733a2f2f6e6169766575692e6f73732d636e2d686f6e676b6f6e672e616c6979756e63732e636f6d2f6e616976656c6f676f2e737667" width="46"/> <img src="https://camo.githubusercontent.com/b8ebecade711b9ae1fa306e7a1c9dd680fb56b0e2b9f015fec9cbad343570353/68747470733a2f2f6e6169766575692e6f73732d636e2d686f6e676b6f6e672e616c6979756e63732e636f6d2f6e616976656c6f676f2e737667" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/alibaba/formily">formily</a></td>
<td align="center" width="180"><a href="https://github.com/vuejs/jsx-next">jsx-next</a></td>
<td align="center" width="180"><a href="https://github.com/mui/material-ui">material-ui</a></td>
<td align="center" width="180"><a href="https://github.com/TuSimple/naive-ui">naive-ui</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/jdf2e/nutui"> <a href="https://github.com/jdf2e/nutui">
<img src="https://img14.360buyimg.com/imagetools/jfs/t1/167902/2/8762/791358/603742d7E9b4275e3/e09d8f9a8bf4c0ef.png" width="46"/> <img src="https://img14.360buyimg.com/imagetools/jfs/t1/167902/2/8762/791358/603742d7E9b4275e3/e09d8f9a8bf4c0ef.png" width="46"/>
@@ -119,18 +136,6 @@ Please leave a message at [**here**](https://github.com/actions-cool/issues-help
<img src="https://user-images.githubusercontent.com/29775873/129505900-ca248179-2435-429d-9fd3-779206bcd899.png" width="46"/> <img src="https://user-images.githubusercontent.com/29775873/129505900-ca248179-2435-429d-9fd3-779206bcd899.png" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/mui/material-ui">material-ui</a></td>
<td align="center" width="180"><a href="https://github.com/TuSimple/naive-ui">naive-ui</a></td>
<td align="center" width="180"><a href="https://github.com/jdf2e/nutui">nutui</a></td>
<td align="center" width="180"><a href="https://github.com/prettier/prettier">prettier</a></td>
</tr><tr>
<td align="center" width="180">
<a href="https://github.com/ant-design/pro-components">
<img src="https://avatars1.githubusercontent.com/u/12101536?s=200&v=4" width="46"/>
</a>
</td>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/react-component"> <a href="https://github.com/react-component">
<img src="https://avatars3.githubusercontent.com/u/9441414?s=200&v=4" width="46"/> <img src="https://avatars3.githubusercontent.com/u/9441414?s=200&v=4" width="46"/>
@@ -141,18 +146,18 @@ Please leave a message at [**here**](https://github.com/actions-cool/issues-help
<img src="https://user-images.githubusercontent.com/29775873/129506058-b0d8c741-f73a-496c-98de-7db2fb586db7.png" width="46"/> <img src="https://user-images.githubusercontent.com/29775873/129506058-b0d8c741-f73a-496c-98de-7db2fb586db7.png" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/jdf2e/nutui">nutui</a></td>
<td align="center" width="180"><a href="https://github.com/prettier/prettier">prettier</a></td>
<td align="center" width="180"><a href="https://github.com/react-component">react-component</a></td>
<td align="center" width="180"><a href="https://github.com/lijinke666/react-music-player">react-music-player</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/antvis/S2"> <a href="https://github.com/antvis/S2">
<img src="https://gw.alipayobjects.com/mdn/rms_56cbb2/afts/img/A*TI8XSK3W0EkAAAAAAAAAAAAAARQnAQ" width="46"/> <img src="https://gw.alipayobjects.com/mdn/rms_56cbb2/afts/img/A*TI8XSK3W0EkAAAAAAAAAAAAAARQnAQ" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/ant-design/pro-components">pro-components</a></td>
<td align="center" width="180"><a href="https://github.com/react-component">react-component</a></td>
<td align="center" width="180"><a href="https://github.com/lijinke666/react-music-player">react-music-player</a></td>
<td align="center" width="180"><a href="https://github.com/antvis/S2">S2</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/nolimits4web/swiper"> <a href="https://github.com/nolimits4web/swiper">
<img src="https://user-images.githubusercontent.com/29775873/156721728-3b0021ea-6932-4a77-a104-2e0bad97346e.png" width="46"/> <img src="https://user-images.githubusercontent.com/29775873/156721728-3b0021ea-6932-4a77-a104-2e0bad97346e.png" width="46"/>
@@ -168,18 +173,18 @@ Please leave a message at [**here**](https://github.com/actions-cool/issues-help
<img src="https://avatars.githubusercontent.com/u/65625612?s=200&v=4" width="46"/> <img src="https://avatars.githubusercontent.com/u/65625612?s=200&v=4" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/antvis/S2">S2</a></td>
<td align="center" width="180"><a href="https://github.com/nolimits4web/swiper">swiper</a></td>
<td align="center" width="180"><a href="https://github.com/umijs/umi">umi</a></td>
<td align="center" width="180"><a href="https://github.com/vitejs/vite">vite</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/vitest-dev/vitest"> <a href="https://github.com/vitest-dev/vitest">
<img src="https://user-images.githubusercontent.com/11247099/145112184-a9ff6727-661c-439d-9ada-963124a281f7.png" width="46"/> <img src="https://user-images.githubusercontent.com/11247099/145112184-a9ff6727-661c-439d-9ada-963124a281f7.png" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/nolimits4web/swiper">swiper</a></td>
<td align="center" width="180"><a href="https://github.com/umijs/umi">umi</a></td>
<td align="center" width="180"><a href="https://github.com/vitejs/vite">vite</a></td>
<td align="center" width="180"><a href="https://github.com/vitest-dev/vitest">vitest</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/AttoJS/vue-request"> <a href="https://github.com/AttoJS/vue-request">
<img src="https://user-images.githubusercontent.com/29775873/129506134-55044c85-24cd-47d3-81ef-dba842214d71.png" width="46"/> <img src="https://user-images.githubusercontent.com/29775873/129506134-55044c85-24cd-47d3-81ef-dba842214d71.png" width="46"/>
@@ -195,13 +200,12 @@ Please leave a message at [**here**](https://github.com/actions-cool/issues-help
<img src="https://avatars1.githubusercontent.com/u/70757173?s=200&v=4" width="46"/> <img src="https://avatars1.githubusercontent.com/u/70757173?s=200&v=4" width="46"/>
</a> </a>
</td> </td>
<td align="center" width="180"></td>
</tr> </tr>
<tr> <tr>
<td align="center" width="180"><a href="https://github.com/vitest-dev/vitest">vitest</a></td>
<td align="center" width="180"><a href="https://github.com/AttoJS/vue-request">vue-request</a></td> <td align="center" width="180"><a href="https://github.com/AttoJS/vue-request">vue-request</a></td>
<td align="center" width="180"><a href="https://github.com/vuepress/vuepress-next">vuepress-next</a></td> <td align="center" width="180"><a href="https://github.com/vuepress/vuepress-next">vuepress-next</a></td>
<td align="center" width="180"><a href="https://github.com/zoo-js/zoo">zoo</a></td> <td align="center" width="180"><a href="https://github.com/zoo-js/zoo">zoo</a></td>
<td align="center" width="180"></td>
</tr> </tr>
</table> </table>
@@ -251,6 +255,7 @@ When the following list does not have the features you want, you can submit it i
- [`lock-issues`](#lock-issues) - [`lock-issues`](#lock-issues)
- [`mark-assignees`](#mark-assignees) - [`mark-assignees`](#mark-assignees)
- [`mark-duplicate`](#mark-duplicate) - [`mark-duplicate`](#mark-duplicate)
- [`toggle-labels`](#toggle-labels)
- [`welcome`](#welcome) - [`welcome`](#welcome)
## 🚀 Usage ## 🚀 Usage
@@ -941,6 +946,7 @@ Find the current repository, the creator is k , the title contains `this` , the
issue-state: 'open' issue-state: 'open'
title-includes: 'this' title-includes: 'this'
body-includes: 'that' body-includes: 'that'
labels: 'documentation'
``` ```
| Param | Desc | Type | Required | | Param | Desc | Type | Required |
@@ -951,6 +957,7 @@ Find the current repository, the creator is k , the title contains `this` , the
| issue-creator | Creator filtering | string | ✖ | | issue-creator | Creator filtering | string | ✖ |
| title-includes | Title filtering | string | ✖ | | title-includes | Title filtering | string | ✖ |
| body-includes | Body filtering | string | ✖ | | body-includes | Body filtering | string | ✖ |
| labels | Labels filtering | string | ✖ |
| exclude-labels | Exclude labels filtering | string | ✖ | | exclude-labels | Exclude labels filtering | string | ✖ |
| inactive-day | Inactive days filtering | number | ✖ | | inactive-day | Inactive days filtering | number | ✖ |
| direction | Return sort | string | ✖ | | direction | Return sort | string | ✖ |
@@ -1103,6 +1110,39 @@ jobs:
⏫ [Back to list](#List) ⏫ [Back to list](#List)
#### `toggle-labels`
When an issue is reopened, the set labels are removed if they already exist, otherwise they are added.
```yml
name: Toggle Labels
on:
issues:
types: [reopened]
jobs:
toggle-labels:
runs-on: ubuntu-latest
steps:
- name: Toggle labels
uses: actions-cool/issues-helper@v3
with:
actions: 'toggle-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: 'unread,outdated'
```
| Param | Desc | Type | Required |
| -- | -- | -- | -- |
| actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✖ |
| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ |
| labels | The toggle labels. Delete if the label already exists, add if it does not exist | string | ✖ |
⏫ [Back to list](#List)
#### `welcome` #### `welcome`
When an issue is created, the user who created the issue for the first time is welcome. When an issue is created, the user who created the issue for the first time is welcome.

View File

@@ -10,7 +10,7 @@
一个轻松帮你自动管理 issues 的 GitHub Action 一个轻松帮你自动管理 issues 的 GitHub Action
[![](https://img.shields.io/github/workflow/status/actions-cool/issues-helper/ci?style=flat-square)](https://github.com/actions-cool/issues-helper/actions) [![](https://img.shields.io/github/actions/workflow/status/actions-cool/issues-helper/ci.yml?branch=main&style=flat-square)](https://github.com/actions-cool/issues-helper/actions)
[![](https://img.shields.io/badge/marketplace-issues--helper-red?style=flat-square)](https://github.com/marketplace/actions/issues-helper) [![](https://img.shields.io/badge/marketplace-issues--helper-red?style=flat-square)](https://github.com/marketplace/actions/issues-helper)
![](https://img.shields.io/github/languages/top/actions-cool/issues-helper?color=%2308979c&style=flat-square) ![](https://img.shields.io/github/languages/top/actions-cool/issues-helper?color=%2308979c&style=flat-square)
[![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi)
@@ -56,32 +56,49 @@
</a> </a>
</td> </td>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/vueComponent/ant-design-vue"> <a href="https://github.com/ant-design/ant-design-mobile">
<img src="https://avatars1.githubusercontent.com/u/32120805?s=200&v=4" width="46"/> <img src="https://gw.alipayobjects.com/zos/bmw-prod/b874caa9-4458-412a-9ac6-a61486180a62.svg" width="46"/>
</a> </a>
</td> </td>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/twbs/bootstrap"> <a href="https://github.com/vueComponent/ant-design-vue">
<img src="https://getbootstrap.com/docs/5.1/assets/brand/bootstrap-logo-shadow.png" width="46"/> <img src="https://avatars1.githubusercontent.com/u/32120805?s=200&v=4" width="46"/>
</a> </a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td align="center" width="180"><a href="https://github.com/ant-design/ant-design">ant-design</a></td> <td align="center" width="180"><a href="https://github.com/ant-design/ant-design">ant-design</a></td>
<td align="center" width="180"><a href="https://github.com/ant-design-blazor/ant-design-blazor">ant-design-blazor</a></td> <td align="center" width="180"><a href="https://github.com/ant-design-blazor/ant-design-blazor">ant-design-blazor</a></td>
<td align="center" width="180"><a href="https://github.com/ant-design/ant-design-mobile">ant-design-mobile</a></td>
<td align="center" width="180"><a href="https://github.com/vueComponent/ant-design-vue">ant-design-vue</a></td> <td align="center" width="180"><a href="https://github.com/vueComponent/ant-design-vue">ant-design-vue</a></td>
<td align="center" width="180"><a href="https://github.com/twbs/bootstrap">bootstrap</a></td>
</tr><tr> </tr><tr>
<td align="center" width="180">
<a href="https://github.com/twbs/bootstrap">
<img src="https://getbootstrap.com/docs/5.1/assets/brand/bootstrap-logo-shadow.png" width="46"/>
</a>
</td>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/umijs/dumi"> <a href="https://github.com/umijs/dumi">
<img src="https://avatars1.githubusercontent.com/u/33895495?s=200&v=4" width="46"/> <img src="https://avatars1.githubusercontent.com/u/33895495?s=200&v=4" width="46"/>
</a> </a>
</td> </td>
<td align="center" width="180">
<a href="https://github.com/electron/electron">
<img src="https://avatars.githubusercontent.com/u/13409222?s=200&v=4" width="46"/>
</a>
</td>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/element-plus/element-plus"> <a href="https://github.com/element-plus/element-plus">
<img src="https://avatars.githubusercontent.com/u/68583457" width="46"/> <img src="https://avatars.githubusercontent.com/u/68583457" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/twbs/bootstrap">bootstrap</a></td>
<td align="center" width="180"><a href="https://github.com/umijs/dumi">dumi</a></td>
<td align="center" width="180"><a href="https://github.com/electron/electron">electron</a></td>
<td align="center" width="180"><a href="https://github.com/element-plus/element-plus">element-plus</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/alibaba/formily"> <a href="https://github.com/alibaba/formily">
<img src="https://img.alicdn.com/imgextra/i2/O1CN01Kq3OHU1fph6LGqjIz_!!6000000004056-55-tps-1141-150.svg" width=""/> <img src="https://img.alicdn.com/imgextra/i2/O1CN01Kq3OHU1fph6LGqjIz_!!6000000004056-55-tps-1141-150.svg" width=""/>
@@ -92,13 +109,6 @@
<img src="https://avatars.githubusercontent.com/u/6128107?s=200&v=4" width="46"/> <img src="https://avatars.githubusercontent.com/u/6128107?s=200&v=4" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/umijs/dumi">dumi</a></td>
<td align="center" width="180"><a href="https://github.com/element-plus/element-plus">element-plus</a></td>
<td align="center" width="180"><a href="https://github.com/alibaba/formily">formily</a></td>
<td align="center" width="180"><a href="https://github.com/vuejs/jsx-next">jsx-next</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/mui/material-ui"> <a href="https://github.com/mui/material-ui">
<img src="https://avatars.githubusercontent.com/u/33663932?s=200&v=4" width="46"/> <img src="https://avatars.githubusercontent.com/u/33663932?s=200&v=4" width="46"/>
@@ -109,6 +119,13 @@
<img src="https://camo.githubusercontent.com/b8ebecade711b9ae1fa306e7a1c9dd680fb56b0e2b9f015fec9cbad343570353/68747470733a2f2f6e6169766575692e6f73732d636e2d686f6e676b6f6e672e616c6979756e63732e636f6d2f6e616976656c6f676f2e737667" width="46"/> <img src="https://camo.githubusercontent.com/b8ebecade711b9ae1fa306e7a1c9dd680fb56b0e2b9f015fec9cbad343570353/68747470733a2f2f6e6169766575692e6f73732d636e2d686f6e676b6f6e672e616c6979756e63732e636f6d2f6e616976656c6f676f2e737667" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/alibaba/formily">formily</a></td>
<td align="center" width="180"><a href="https://github.com/vuejs/jsx-next">jsx-next</a></td>
<td align="center" width="180"><a href="https://github.com/mui/material-ui">material-ui</a></td>
<td align="center" width="180"><a href="https://github.com/TuSimple/naive-ui">naive-ui</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/jdf2e/nutui"> <a href="https://github.com/jdf2e/nutui">
<img src="https://img14.360buyimg.com/imagetools/jfs/t1/167902/2/8762/791358/603742d7E9b4275e3/e09d8f9a8bf4c0ef.png" width="46"/> <img src="https://img14.360buyimg.com/imagetools/jfs/t1/167902/2/8762/791358/603742d7E9b4275e3/e09d8f9a8bf4c0ef.png" width="46"/>
@@ -119,18 +136,6 @@
<img src="https://user-images.githubusercontent.com/29775873/129505900-ca248179-2435-429d-9fd3-779206bcd899.png" width="46"/> <img src="https://user-images.githubusercontent.com/29775873/129505900-ca248179-2435-429d-9fd3-779206bcd899.png" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/mui/material-ui">material-ui</a></td>
<td align="center" width="180"><a href="https://github.com/TuSimple/naive-ui">naive-ui</a></td>
<td align="center" width="180"><a href="https://github.com/jdf2e/nutui">nutui</a></td>
<td align="center" width="180"><a href="https://github.com/prettier/prettier">prettier</a></td>
</tr><tr>
<td align="center" width="180">
<a href="https://github.com/ant-design/pro-components">
<img src="https://avatars1.githubusercontent.com/u/12101536?s=200&v=4" width="46"/>
</a>
</td>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/react-component"> <a href="https://github.com/react-component">
<img src="https://avatars3.githubusercontent.com/u/9441414?s=200&v=4" width="46"/> <img src="https://avatars3.githubusercontent.com/u/9441414?s=200&v=4" width="46"/>
@@ -141,18 +146,18 @@
<img src="https://user-images.githubusercontent.com/29775873/129506058-b0d8c741-f73a-496c-98de-7db2fb586db7.png" width="46"/> <img src="https://user-images.githubusercontent.com/29775873/129506058-b0d8c741-f73a-496c-98de-7db2fb586db7.png" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/jdf2e/nutui">nutui</a></td>
<td align="center" width="180"><a href="https://github.com/prettier/prettier">prettier</a></td>
<td align="center" width="180"><a href="https://github.com/react-component">react-component</a></td>
<td align="center" width="180"><a href="https://github.com/lijinke666/react-music-player">react-music-player</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/antvis/S2"> <a href="https://github.com/antvis/S2">
<img src="https://gw.alipayobjects.com/mdn/rms_56cbb2/afts/img/A*TI8XSK3W0EkAAAAAAAAAAAAAARQnAQ" width="46"/> <img src="https://gw.alipayobjects.com/mdn/rms_56cbb2/afts/img/A*TI8XSK3W0EkAAAAAAAAAAAAAARQnAQ" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/ant-design/pro-components">pro-components</a></td>
<td align="center" width="180"><a href="https://github.com/react-component">react-component</a></td>
<td align="center" width="180"><a href="https://github.com/lijinke666/react-music-player">react-music-player</a></td>
<td align="center" width="180"><a href="https://github.com/antvis/S2">S2</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/nolimits4web/swiper"> <a href="https://github.com/nolimits4web/swiper">
<img src="https://user-images.githubusercontent.com/29775873/156721728-3b0021ea-6932-4a77-a104-2e0bad97346e.png" width="46"/> <img src="https://user-images.githubusercontent.com/29775873/156721728-3b0021ea-6932-4a77-a104-2e0bad97346e.png" width="46"/>
@@ -168,18 +173,18 @@
<img src="https://avatars.githubusercontent.com/u/65625612?s=200&v=4" width="46"/> <img src="https://avatars.githubusercontent.com/u/65625612?s=200&v=4" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/antvis/S2">S2</a></td>
<td align="center" width="180"><a href="https://github.com/nolimits4web/swiper">swiper</a></td>
<td align="center" width="180"><a href="https://github.com/umijs/umi">umi</a></td>
<td align="center" width="180"><a href="https://github.com/vitejs/vite">vite</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/vitest-dev/vitest"> <a href="https://github.com/vitest-dev/vitest">
<img src="https://user-images.githubusercontent.com/11247099/145112184-a9ff6727-661c-439d-9ada-963124a281f7.png" width="46"/> <img src="https://user-images.githubusercontent.com/11247099/145112184-a9ff6727-661c-439d-9ada-963124a281f7.png" width="46"/>
</a> </a>
</td> </td>
</tr>
<tr>
<td align="center" width="180"><a href="https://github.com/nolimits4web/swiper">swiper</a></td>
<td align="center" width="180"><a href="https://github.com/umijs/umi">umi</a></td>
<td align="center" width="180"><a href="https://github.com/vitejs/vite">vite</a></td>
<td align="center" width="180"><a href="https://github.com/vitest-dev/vitest">vitest</a></td>
</tr><tr>
<td align="center" width="180"> <td align="center" width="180">
<a href="https://github.com/AttoJS/vue-request"> <a href="https://github.com/AttoJS/vue-request">
<img src="https://user-images.githubusercontent.com/29775873/129506134-55044c85-24cd-47d3-81ef-dba842214d71.png" width="46"/> <img src="https://user-images.githubusercontent.com/29775873/129506134-55044c85-24cd-47d3-81ef-dba842214d71.png" width="46"/>
@@ -195,13 +200,12 @@
<img src="https://avatars1.githubusercontent.com/u/70757173?s=200&v=4" width="46"/> <img src="https://avatars1.githubusercontent.com/u/70757173?s=200&v=4" width="46"/>
</a> </a>
</td> </td>
<td align="center" width="180"></td>
</tr> </tr>
<tr> <tr>
<td align="center" width="180"><a href="https://github.com/vitest-dev/vitest">vitest</a></td>
<td align="center" width="180"><a href="https://github.com/AttoJS/vue-request">vue-request</a></td> <td align="center" width="180"><a href="https://github.com/AttoJS/vue-request">vue-request</a></td>
<td align="center" width="180"><a href="https://github.com/vuepress/vuepress-next">vuepress-next</a></td> <td align="center" width="180"><a href="https://github.com/vuepress/vuepress-next">vuepress-next</a></td>
<td align="center" width="180"><a href="https://github.com/zoo-js/zoo">zoo</a></td> <td align="center" width="180"><a href="https://github.com/zoo-js/zoo">zoo</a></td>
<td align="center" width="180"></td>
</tr> </tr>
</table> </table>
@@ -255,6 +259,7 @@
- [`lock-issues`](#lock-issues) - [`lock-issues`](#lock-issues)
- [`mark-assignees`](#mark-assignees) - [`mark-assignees`](#mark-assignees)
- [`mark-duplicate`](#mark-duplicate) - [`mark-duplicate`](#mark-duplicate)
- [`toggle-labels`](#toggle-labels)
- [`welcome`](#welcome) - [`welcome`](#welcome)
## 🚀 使 用 ## 🚀 使 用
@@ -940,6 +945,7 @@ jobs:
issue-state: 'open' issue-state: 'open'
title-includes: 'this' title-includes: 'this'
body-includes: 'that' body-includes: 'that'
labels: 'documentation'
``` ```
| 参数 | 描述 | 类型 | 必填 | | 参数 | 描述 | 类型 | 必填 |
@@ -950,6 +956,7 @@ jobs:
| issue-creator | 创建者筛选 | string | ✖ | | issue-creator | 创建者筛选 | string | ✖ |
| title-includes | 标题包含过滤,不填时无校验 | string | ✖ | | title-includes | 标题包含过滤,不填时无校验 | string | ✖ |
| body-includes | 内容包含过滤,不填时无校验 | string | ✖ | | body-includes | 内容包含过滤,不填时无校验 | string | ✖ |
| labels | 标签筛选 | string | ✖ |
| exclude-labels | 排除标签筛选 | string | ✖ | | exclude-labels | 排除标签筛选 | string | ✖ |
| inactive-day | 非活跃天数筛选 | number | ✖ | | inactive-day | 非活跃天数筛选 | number | ✖ |
| direction | 返回 `issues` 排序 | string | ✖ | | direction | 返回 `issues` 排序 | string | ✖ |
@@ -1102,6 +1109,39 @@ jobs:
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
#### `toggle-labels`
当一个 issue 被重新打开,判断设置的 labels 如果已经存在则进行删除,否则进行添加。
```yml
name: Toggle Labels
on:
issues:
types: [reopened]
jobs:
toggle-labels:
runs-on: ubuntu-latest
steps:
- name: Toggle labels
uses: actions-cool/issues-helper@v3
with:
actions: 'toggle-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: 'unread,outdated'
```
| 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✖ |
| issue-number | 指定的 issue当不传时会从触发事件中获取 | number | ✖ |
| labels | 切换 labels。如果 label 已存在则删除,不存在则添加 | string | ✖ |
⏫ [返回列表](#列-表)
#### `welcome` #### `welcome`
当一个 issue 新建时,对首次新建 issue 的用户进行欢迎。若用户非首次新建,则无操作。 当一个 issue 新建时,对首次新建 issue 的用户进行欢迎。若用户非首次新建,则无操作。

View File

@@ -50,10 +50,6 @@ const users = [
url: 'https://github.com/react-component', url: 'https://github.com/react-component',
logo: 'https://avatars3.githubusercontent.com/u/9441414?s=200&v=4' logo: 'https://avatars3.githubusercontent.com/u/9441414?s=200&v=4'
}, },
{
url: 'https://github.com/ant-design/pro-components',
logo: 'https://avatars1.githubusercontent.com/u/12101536?s=200&v=4'
},
{ {
url: 'https://github.com/prettier/prettier', url: 'https://github.com/prettier/prettier',
logo: 'https://user-images.githubusercontent.com/29775873/129505900-ca248179-2435-429d-9fd3-779206bcd899.png', logo: 'https://user-images.githubusercontent.com/29775873/129505900-ca248179-2435-429d-9fd3-779206bcd899.png',
@@ -103,6 +99,14 @@ const users = [
url: 'https://github.com/vitest-dev/vitest', url: 'https://github.com/vitest-dev/vitest',
logo: 'https://user-images.githubusercontent.com/11247099/145112184-a9ff6727-661c-439d-9ada-963124a281f7.png', logo: 'https://user-images.githubusercontent.com/11247099/145112184-a9ff6727-661c-439d-9ada-963124a281f7.png',
}, },
{
url: 'https://github.com/electron/electron',
logo: 'https://avatars.githubusercontent.com/u/13409222?s=200&v=4',
},
{
url: 'https://github.com/ant-design/ant-design-mobile',
logo: 'https://gw.alipayobjects.com/zos/bmw-prod/b874caa9-4458-412a-9ac6-a61486180a62.svg',
},
]; ];
// ************************************************************************** // **************************************************************************

View File

@@ -117,5 +117,5 @@ outputs:
description: 'Check issue' description: 'Check issue'
runs: runs:
using: node12 using: node16
main: 'dist/index.js' main: 'dist/index.js'

1693
dist/index.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -32,7 +32,7 @@
"all": "npm run lint-all && npm run test && npm run package" "all": "npm run lint-all && npm run test && npm run package"
}, },
"dependencies": { "dependencies": {
"@actions/core": "^1.6.0", "@actions/core": "^1.10.0",
"@actions/github": "^4.0.0", "@actions/github": "^4.0.0",
"@octokit/rest": "^18.0.12", "@octokit/rest": "^18.0.12",
"actions-util": "^1.1.3", "actions-util": "^1.1.3",

View File

@@ -30,7 +30,7 @@ function getChangelog(content) {
} }
} }
} }
return changeLog.join('\n'); return changeLog.join('\n\n');
} }
const changelogPath = path.join(__dirname, '..', CHANGELOG_NAME); const changelogPath = path.join(__dirname, '..', CHANGELOG_NAME);

View File

@@ -38,6 +38,7 @@ async function run() {
if (tags.includes(tagSimple)) { if (tags.includes(tagSimple)) {
console.log(chalk.yellow(`[Git Action] Delete ${tagSimple} tag`)); console.log(chalk.yellow(`[Git Action] Delete ${tagSimple} tag`));
execSync(`git push origin :refs/tags/${tagSimple}`); execSync(`git push origin :refs/tags/${tagSimple}`);
console.log(chalk.green(`[Git Action] Delete ${tagSimple} tag success`));
} }
console.log(chalk.yellow(`[Git Action] Add new simple ${tagSimple} tag`)); console.log(chalk.yellow(`[Git Action] Add new simple ${tagSimple} tag`));

View File

@@ -45,27 +45,29 @@ ${table}
const point = '<table>'; const point = '<table>';
const cnPoint = `## 图标`; const cnPoint = `## 图标`;
const enPoint = `## Badge`; const enPoint = `## Badge`;
const ReadmeCN = './README.zh-CN.md';
const ReadmeEN = './README.md';
// ************************************************************************** // **************************************************************************
const cn = readFileSync('./README.md', 'utf8'); const cn = readFileSync(ReadmeCN, 'utf8');
const cnIn = cn.indexOf(point); const cnIn = cn.indexOf(point);
const cnAfterIn = cn.indexOf(cnPoint); const cnAfterIn = cn.indexOf(cnPoint);
const cnBefore = cn.substring(0, cnIn); const cnBefore = cn.substring(0, cnIn);
const cnAfter = cn.substring(cnAfterIn, cn.length); const cnAfter = cn.substring(cnAfterIn, cn.length);
const newcn = cnBefore + table + cnAfter; const newcn = cnBefore + table + cnAfter;
writeFileSync('./README.md', newcn); writeFileSync(ReadmeCN, newcn);
console.log(`🎉 Done cn`); console.log(`🎉 Done cn`);
// ************************************************************************** // **************************************************************************
const en = readFileSync('./README.en-US.md', 'utf8'); const en = readFileSync(ReadmeEN, 'utf8');
const enIn = en.indexOf(point); const enIn = en.indexOf(point);
const enAfterIn = en.indexOf(enPoint); const enAfterIn = en.indexOf(enPoint);
const enBefore = en.substring(0, enIn); const enBefore = en.substring(0, enIn);
const enAfter = en.substring(enAfterIn, en.length); const enAfter = en.substring(enAfterIn, en.length);
const newen = enBefore + table + enAfter; const newen = enBefore + table + enAfter;
writeFileSync('./README.en-US.md', newen); writeFileSync(ReadmeEN, newen);
console.log(`🎉 Done en`); console.log(`🎉 Done en`);
// ************************************************************************** // **************************************************************************

View File

@@ -16,6 +16,7 @@ import {
doCreateComment, doCreateComment,
doCreateCommentEmoji, doCreateCommentEmoji,
doLockIssue, doLockIssue,
doRemoveLabels,
doSetLabels, doSetLabels,
doUpdateComment, doUpdateComment,
} from './base'; } from './base';
@@ -361,6 +362,32 @@ export async function doMarkDuplicate(
} }
} }
export async function doToggleLabels(labels: string[] = []) {
const issue = await ICE.getIssue();
const baseLabels: string[] = issue.labels.map(({ name }: any) => name);
const addLabels = [];
const removeLabels = [];
for (const label of labels) {
if (baseLabels.includes(label)) {
removeLabels.push(label);
} else {
addLabels.push(label);
}
}
if (removeLabels.length) {
await doRemoveLabels(removeLabels);
}
if (addLabels.length) {
await doAddLabels(addLabels);
}
core.info(`[doToggleLabels] Done!`);
}
export async function doWelcome( export async function doWelcome(
auth: string, auth: string,
issueNumber: number, issueNumber: number,

View File

@@ -97,7 +97,6 @@ export async function doDeleteComment(_commentId: number | void) {
export async function doGetIssue() { export async function doGetIssue() {
const { number, title, body, state, labels, assignees } = await ICE.getIssue(); const { number, title, body, state, labels, assignees } = await ICE.getIssue();
core.setOutput('issue-number', number); core.setOutput('issue-number', number);
core.setOutput('issue-title', title || ''); core.setOutput('issue-title', title || '');
core.setOutput('issue-body', body || ''); core.setOutput('issue-body', body || '');

View File

@@ -14,6 +14,7 @@ import {
doLockIssues, doLockIssues,
doMarkAssignees, doMarkAssignees,
doMarkDuplicate, doMarkDuplicate,
doToggleLabels,
doWelcome, doWelcome,
initAdvancedICE, initAdvancedICE,
} from './advanced'; } from './advanced';
@@ -251,6 +252,10 @@ export class IssueHelperEngine implements IIssueHelperEngine {
await doMarkDuplicate(ctx.payload.comment as TCommentInfo, closeReason, labels, emoji); await doMarkDuplicate(ctx.payload.comment as TCommentInfo, closeReason, labels, emoji);
break; break;
} }
case 'toggle-labels': {
await doToggleLabels(labels);
break;
}
case 'welcome': { case 'welcome': {
if (ctx.eventName === 'issues' && ctx.payload.action === 'opened') { if (ctx.eventName === 'issues' && ctx.payload.action === 'opened') {
await doWelcome(ctx.actor, issueNumber, body, labels, assignees, emoji); await doWelcome(ctx.actor, issueNumber, body, labels, assignees, emoji);

View File

@@ -56,5 +56,6 @@ export type TAction =
| 'lock-issues' | 'lock-issues'
| 'mark-assignees' | 'mark-assignees'
| 'mark-duplicate' | 'mark-duplicate'
| 'toggle-labels'
| 'welcome'; | 'welcome';
//// [ Advanced End ] //// [ Advanced End ]

View File

@@ -9,8 +9,8 @@ export const dealRandomAssignees = (assignees: string, randomTo: string | void):
return arr; return arr;
}; };
export const matchKeyword = (content: string, keywords: string[]): boolean => { export const matchKeyword = (content: string = '', keywords: string[]): boolean => {
return !!keywords.find(item => content.toLowerCase().includes(item)); return !!keywords.find(item => content?.toLowerCase().includes(item));
}; };
export const checkDuplicate = (body: string | void): boolean => { export const checkDuplicate = (body: string | void): boolean => {

View File

@@ -351,6 +351,37 @@ Note: Duplicate created with the concise command does not display the content of
![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*PN2tS7PjDQ4AAAAAAAAAAAAAARQnAQ) ![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*PN2tS7PjDQ4AAAAAAAAAAAAAARQnAQ)
## `toggle-labels`
When an issue is reopened, the set labels are removed if they already exist, otherwise they are added.
```yml
name: Toggle Labels
on:
issues:
types: [reopened]
jobs:
toggle-labels:
runs-on: ubuntu-latest
steps:
- name: Toggle labels
uses: actions-cool/issues-helper@v3
with:
actions: 'toggle-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: 'unread,outdated'
```
| Param | Desc | Type | Required |
| -- | -- | -- | -- |
| actions | Action type | string | ✔ |
| token | [Token explain](/guide/ref#-token) | string | ✖ |
| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ |
| labels | The toggle labels. Delete if the label already exists, add if it does not exist | string | ✖ |
## `welcome` ## `welcome`
When an issue is created, the user who created the issue for the first time is welcome. When an issue is created, the user who created the issue for the first time is welcome.

View File

@@ -348,6 +348,37 @@ jobs:
![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*PN2tS7PjDQ4AAAAAAAAAAAAAARQnAQ) ![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*PN2tS7PjDQ4AAAAAAAAAAAAAARQnAQ)
## `toggle-labels`
当一个 issue 被重新打开,判断设置的 labels 如果已经存在则进行删除,否则进行添加。
```yml
name: Toggle Labels
on:
issues:
types: [reopened]
jobs:
toggle-labels:
runs-on: ubuntu-latest
steps:
- name: Toggle labels
uses: actions-cool/issues-helper@v3
with:
actions: 'toggle-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: 'unread,outdated'
```
| 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ |
| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ |
| issue-number | 指定的 issue当不传时会从触发事件中获取 | number | ✖ |
| labels | 切换 labels。如果 label 已存在则删除,不存在则添加 | string | ✖ |
## `welcome` ## `welcome`
当一个 issue 新建时,对首次新建 issue 的用户进行欢迎。若用户非首次新建,则无操作。 当一个 issue 新建时,对首次新建 issue 的用户进行欢迎。若用户非首次新建,则无操作。

View File

@@ -2,12 +2,13 @@
# yarn lockfile v1 # yarn lockfile v1
"@actions/core@^1.6.0": "@actions/core@^1.10.0":
version "1.6.0" version "1.10.0"
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.6.0.tgz#0568e47039bfb6a9170393a73f3b7eb3b22462cb" resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.10.0.tgz#44551c3c71163949a2f06e94d9ca2157a0cfac4f"
integrity sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw== integrity sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==
dependencies: dependencies:
"@actions/http-client" "^1.0.11" "@actions/http-client" "^2.0.1"
uuid "^8.3.2"
"@actions/github@^4.0.0": "@actions/github@^4.0.0":
version "4.0.0" version "4.0.0"
@@ -19,13 +20,20 @@
"@octokit/plugin-paginate-rest" "^2.2.3" "@octokit/plugin-paginate-rest" "^2.2.3"
"@octokit/plugin-rest-endpoint-methods" "^4.0.0" "@octokit/plugin-rest-endpoint-methods" "^4.0.0"
"@actions/http-client@^1.0.11", "@actions/http-client@^1.0.8": "@actions/http-client@^1.0.8":
version "1.0.11" version "1.0.11"
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.11.tgz#c58b12e9aa8b159ee39e7dd6cbd0e91d905633c0" resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.11.tgz#c58b12e9aa8b159ee39e7dd6cbd0e91d905633c0"
integrity sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg== integrity sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==
dependencies: dependencies:
tunnel "0.0.6" tunnel "0.0.6"
"@actions/http-client@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.0.1.tgz#873f4ca98fe32f6839462a6f046332677322f99c"
integrity sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==
dependencies:
tunnel "^0.0.6"
"@ampproject/remapping@^2.0.0": "@ampproject/remapping@^2.0.0":
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.1.0.tgz#72becdf17ee44b2d1ac5651fb12f1952c336fe23" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.1.0.tgz#72becdf17ee44b2d1ac5651fb12f1952c336fe23"
@@ -22201,7 +22209,7 @@ tunnel-agent@^0.6.0:
dependencies: dependencies:
safe-buffer "^5.0.1" safe-buffer "^5.0.1"
tunnel@0.0.6: tunnel@0.0.6, tunnel@^0.0.6:
version "0.0.6" version "0.0.6"
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c"
integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==