From ae3f30b1efb98b08d450fda53d03e5c8cfa4b867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=83=E5=87=9B?= Date: Fri, 2 Sep 2022 17:03:22 +0800 Subject: [PATCH] docs: adjust default language --- README.en-US.md | 1227 ------------------ README.md | 751 +++++------ README.zh-CN.md | 1248 +++++++++++++++++++ web/.umirc.ts | 36 +- web/docs/advanced.en-US.md | 391 ------ web/docs/advanced.md | 309 ++--- web/docs/advanced.zh-CN.md | 386 ++++++ web/docs/base.en-US.md | 441 ------- web/docs/base.md | 289 +++-- web/docs/base.zh-CN.md | 460 +++++++ web/docs/changelog.en-US.md | 10 - web/docs/changelog.md | 6 +- web/docs/changelog.zh-CN.md | 10 + web/docs/guide/faq.en-US.md | 88 -- web/docs/guide/faq.md | 90 +- web/docs/guide/faq.zh-CN.md | 88 ++ web/docs/guide/index.en-US.md | 23 - web/docs/guide/index.md | 28 +- web/docs/guide/index.zh-CN.md | 23 + web/docs/guide/note.en-US.md | 51 - web/docs/guide/note.md | 39 +- web/docs/guide/note.zh-CN.md | 52 + web/docs/guide/ref.en-US.md | 86 -- web/docs/guide/ref.md | 36 +- web/docs/guide/ref.zh-CN.md | 86 ++ web/docs/guide/start.en-US.md | 67 - web/docs/guide/start.md | 60 +- web/docs/guide/start.zh-CN.md | 67 + web/docs/index.md | 40 +- web/docs/{index.en-US.md => index.zh-CN.md} | 42 +- 30 files changed, 3306 insertions(+), 3224 deletions(-) delete mode 100644 README.en-US.md create mode 100644 README.zh-CN.md delete mode 100644 web/docs/advanced.en-US.md create mode 100644 web/docs/advanced.zh-CN.md delete mode 100644 web/docs/base.en-US.md create mode 100644 web/docs/base.zh-CN.md delete mode 100644 web/docs/changelog.en-US.md create mode 100644 web/docs/changelog.zh-CN.md delete mode 100644 web/docs/guide/faq.en-US.md create mode 100644 web/docs/guide/faq.zh-CN.md delete mode 100644 web/docs/guide/index.en-US.md create mode 100644 web/docs/guide/index.zh-CN.md delete mode 100644 web/docs/guide/note.en-US.md create mode 100644 web/docs/guide/note.zh-CN.md delete mode 100644 web/docs/guide/ref.en-US.md create mode 100644 web/docs/guide/ref.zh-CN.md delete mode 100644 web/docs/guide/start.en-US.md create mode 100644 web/docs/guide/start.zh-CN.md rename web/docs/{index.en-US.md => index.zh-CN.md} (52%) diff --git a/README.en-US.md b/README.en-US.md deleted file mode 100644 index 2ecdc6ec..00000000 --- a/README.en-US.md +++ /dev/null @@ -1,1227 +0,0 @@ -

- - - -

- -

🤖 Issues Helper

- -
- -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/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) -[![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) -[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) - -[![](https://img.shields.io/github/stars/actions-cool/issues-helper?style=flat-square)](https://github.com/actions-cool/issues-helper/stargazers) -[![](https://img.shields.io/github/v/release/actions-cool/issues-helper?style=flat-square&color=orange)](https://github.com/actions-cool/issues-helper/releases) -[![](https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square&color=%2308979c)](https://github.com/actions-cool/issues-helper/discussions) -[![](https://img.shields.io/github/license/actions-cool/issues-helper?style=flat-square)](https://github.com/actions-cool/issues-helper/blob/main/LICENSE) - -
- -[简体中文](./README.md) | English - -## 🔗 Link - -- [Online documentation](https://actions-cool.github.io/issues-helper) -- [Online v2 documentation](https://actions-cool.github.io/issues-helper-2.x/) -- [Changelog](./CHANGELOG.md) - -## 😎 Why use GitHub Action? - -1. Complete free -2. Fully automatic -3. Hosted on the GitHub server, as long as GitHub is not down, it is not affected - -> Private projects have a limit of 2000 times per month. [Specific view](https://github.com/settings/billing). Public are unlimited. - -## Who is using? - -Please leave a message at [**here**](https://github.com/actions-cool/issues-helper/issues/6). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
ant-designant-design-blazorant-design-vuebootstrap
- - - - - - - - - - - - - - - -
dumielement-plusformilyjsx-next
- - - - - - - - - - - - - - - -
material-uinaive-uinutuiprettier
- - - - - - - - - - - - - - - -
pro-componentsreact-componentreact-music-playerS2
- - - - - - - - - - - - - - - -
swiperumivitevitest
- - - - - - - - - - - -
vue-requestvuepress-nextzoo
- -## Badge - -If you think `actions-cool` can help you, please copy it to the README to support promotion and bring convenience to more repositories:[![actions-cool](https://img.shields.io/badge/using-actions--cool-blue?style=flat-square)](https://github.com/actions-cool). [More color see](https://github.com/actions-cool/issues-helper/issues/92). - -``` -[![actions-cool](https://img.shields.io/badge/using-actions--cool-blue?style=flat-square)](https://github.com/actions-cool) -``` - -## ⚡ Feedback - -You are very welcome to try it out and put forward your comments. You can use the following methods: - -- Report bugs or consult with [Issue](https://github.com/actions-cool/issues-helper/issues) -- Discuss via [Discussions](https://github.com/actions-cool/issues-helper/discussions) -- Submit [Pull Request](https://github.com/actions-cool/issues-helper/pulls) to improve the code of `issues-helper` - -## List - -When the following list does not have the features you want, you can submit it in [issues](https://github.com/actions-cool/issues-helper/issues). - -- ⭐ Base - - [`add-assignees`](#add-assignees) - - [`add-labels`](#add-labels) - - [`close-issue`](#close-issue) - - [`create-comment`](#create-comment) - - [`create-issue`](#create-issue) - - [`create-label`](#create-label) - - [`delete-comment`](#delete-comment) - - [`lock-issue`](#lock-issue) - - [`open-issue`](#open-issue) - - [`remove-assignees`](#remove-assignees) - - [`remove-labels`](#remove-labels) - - [`set-labels`](#set-labels) - - [`unlock-issue`](#unlock-issue) - - [`update-comment`](#update-comment) - - [`update-issue`](#update-issue) -- 🌟 Advanced - - [`check-inactive`](#check-inactive) - - [`check-issue`](#check-issue) - - [`close-issues`](#close-issues) - - [`find-comments`](#find-comments) - - [`find-issues`](#find-issues) - - [`lock-issues`](#lock-issues) - - [`mark-assignees`](#mark-assignees) - - [`mark-duplicate`](#mark-duplicate) - - [`welcome`](#welcome) - -## 🚀 Usage - -### ⭐ Base - -In order to better display the function, the following is an example of the actual scene, please refer to it flexibly. - -#### `add-assignees` - -When an issue is added or modified, assign this issue to one or more people. - -```yml -name: Add Assigness - -on: - issues: - types: [opened, edited] - -jobs: - add-assigness: - runs-on: ubuntu-latest - steps: - - name: Add assigness - uses: actions-cool/issues-helper@v3 - with: - actions: 'add-assignees' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - assignees: 'xxx' or 'xx1,xx2' - random-to: 1 -``` - -| 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 | ✖ | -| assignees | Designated person. No operation when no input or empty character | string | ✖ | -| random-to | When set, it will be randomly selected in assignees | number | ✖ | - -- `actions` support multiple and separated by comma. Like: `add-assignees,add-labels` -- The `name` can be modified according to the actual situation -- [Reference to on](#github-docs) -- `${{ github.event.issue.number }}` is the current issue. [More references](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events) -- `assignees` support multiple and separated by comma -- You can assign up to 10 people to each issue - -⏫ [Back to list](#List) - -#### `add-labels` - -When the content of a new issue does not contain the specified format, add labels for the issue. - -```yml -name: Add Labels - -on: - issues: - types: [opened] - -jobs: - add-labels: - runs-on: ubuntu-latest - if: contains(github.event.issue.body, 'xxx') == false - steps: - - name: Add labels - uses: actions-cool/issues-helper@v3 - with: - actions: 'add-labels' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - labels: 'bug' or 'xx1,xx2' -``` - -| 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 | New labels. When it is not filled in or is empty character, do not add | string | ✖ | - -- `labels` support multiple and separated by comma - -⏫ [Back to list](#List) - -#### `close-issue` - -Close the specified issue. - -```yml -- name: Close issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'close-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: xxx -``` - -| 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 | ✖ | -| close-reason | Reason for closing. Default `not_planned`, another `completed` | string | ✖ | - -⏫ [Back to list](#List) - -#### `create-comment` - -When a designated label is added, comment on the issue. - -```yml -name: Create Comment - -on: - issues: - types: [labeled] - -jobs: - create-comment: - runs-on: ubuntu-latest - if: github.event.label.name == 'xxx' - steps: - - name: Create comment - uses: actions-cool/issues-helper@v3 - with: - actions: 'create-comment' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - body: | - Hello @${{ github.event.issue.user.login }}. Add some comments. - - 你好 @${{ github.event.issue.user.login }}。巴拉巴拉。 - emoji: '+1' or '+1,heart' -``` - -| 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 | ✖ | -| body | Add comment content | string | ✔ | -| emoji | Add [emoji](#emoji-types) | string | ✖ | - -- No action when `body` is empty -- Return `comment-id`, which can be used for subsequent operations. [Usage reference](#outputs-use) -- `${{ github.event.issue.user.login }}` indicates the creator of the issue -- `emoji` support multiple and separated by comma - -⏫ [Back to list](#List) - -#### `create-issue` - -Here is an example, add an issue at UTC 00:00 on the 1st of every month. - -```yml -name: Create Issue - -on: - schedule: - - cron: "0 0 1 * *" - -jobs: - create-issue: - runs-on: ubuntu-latest - steps: - - name: Create issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'create-issue' - token: ${{ secrets.GITHUB_TOKEN }} - title: 'xxxx' - body: 'xxxx' - labels: 'xx' - assignees: 'xxx' - emoji: '+1' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](#token) | string | ✖ | -| title | The title of the new issue | string | ✔ | -| body | The body of the new issue | string | ✖ | -| labels | The labels for the new issue | string | ✖ | -| assignees | The assignees for the new issue | string | ✖ | -| random-to | When set, it will be randomly selected in assignees | number | ✖ | -| emoji | Add [emoji](#emoji-types) | string | ✖ | - -- No action when `title` is empty -- Return `issue-number`. [Usage reference](#outputs-use) - -⏫ [Back to list](#List) - -#### `create-label` - -Create label. If you want to maintain labels in batches, [see](https://github.com/actions-cool/labels-helper). - -```yml -- name: Create label - uses: actions-cool/issues-helper@v3 - with: - actions: 'create-label' - token: ${{ secrets.GITHUB_TOKEN }} - label-name: 'xx' - label-color: '0095b3' - label-desc: 'xx' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](#token) | string | ✖ | -| label-name | Label name, emoji support | string | ✔ | -| label-color | Label color, the format is hexadecimal color code, without `#` | string | ✖ | -| label-desc | Label description | string | ✖ | - -- `label-name`: If it already exists, no operation -- `label-color`: Default is `ededed` - -⏫ [Back to list](#List) - -#### `delete-comment` - -According to [`comment-id`](#comment-id) delete the specified comment. - -```yml -- name: Delete comment - uses: actions-cool/issues-helper@v3 - with: - actions: 'delete-comment' - token: ${{ secrets.GITHUB_TOKEN }} - comment-id: xxx -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](#token) | string | ✖ | -| comment-id | The comment ID | number | ✔ | - -⏫ [Back to list](#List) - -#### `lock-issue` - -When the `invalid` label is added, the issue is locked. - -```yml -name: Lock Issue - -on: - issues: - types: [labeled] - -jobs: - lock-issue: - runs-on: ubuntu-latest - if: github.event.label.name == 'invalid' - steps: - - name: Lock issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'lock-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} -``` - -| 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 | ✖ | -| lock-reason | Reason for locking issue | string | ✖ | - -- `lock-reason`: Optional values are `off-topic` `too heated` `resolved` `spam` - -⏫ [Back to list](#List) - -#### `open-issue` - -Open the specified issue. - -```yml -- name: Open issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'open-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: xxx -``` - -| 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 | ✖ | - -⏫ [Back to list](#List) - -#### `remove-assignees` - -Remove the person designated by issue. - -```yml -- name: Remove assignees - uses: actions-cool/issues-helper@v3 - with: - actions: 'remove-assignees' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - assignees: 'xx' -``` - -| 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 | ✖ | -| assignees | Designated person removed. When it is an empty character, do not remove | string | ✔ | - -⏫ [Back to list](#List) - -#### `remove-labels` - -Remove the specified labels. - -```yml -- name: Remove labels - uses: actions-cool/issues-helper@v3 - with: - actions: 'remove-labels' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - labels: 'xx' -``` - -| 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 removed labels. When it is a blank character, do not remove | string | ✔ | - -- `labels` supports multiple, such as `x1,x2,x3`, only the labels added by the issue will be removed - -⏫ [Back to list](#List) - -#### `set-labels` - -Replace the labels of issue. - -```yml -- name: Set labels - uses: actions-cool/issues-helper@v3 - with: - actions: 'set-labels' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - labels: 'xx' -``` - -| 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 | labels set. When empty characters, will remove all | string | ✔ | - -⏫ [Back to list](#List) - -#### `unlock-issue` - -Unlock the specified issue. - -```yml -- name: Unlock issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'unlock-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} -``` - -| 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 | ✖ | - -⏫ [Back to list](#List) - -#### `update-comment` - -Update the specified comment according to [`comment-id`](#comment-id). - -The following example shows that 👀 is added for each new comment. - -```yml -name: Add eyes to each comment - -on: - issue_comment: - types: [created] - -jobs: - update-comment: - runs-on: ubuntu-latest - steps: - - name: Update comment - uses: actions-cool/issues-helper@v3 - with: - actions: 'update-comment' - token: ${{ secrets.GITHUB_TOKEN }} - comment-id: ${{ github.event.comment.id }} - emoji: 'eyes' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](#token) | string | ✖ | -| comment-id | The comment ID | number | ✔ | -| out-comments | The output of `find-comments`, if you find multiple, operate multiple | string | ✖ | -| body | Update the content of comment | string | ✖ | -| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | -| emoji | Add [reaction](#emoji-types) | string | ✖ | - -- When `body` is not entered, it will remain as it is -- When `update-mode` is `append`, additional operations will be performed. Anything other than `append` will be replaced. Only effective for `body` - -⏫ [Back to list](#List) - -#### `update-issue` - -Update the specified issue according to the `issue-number`. - -```yml -- name: Update issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'update-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - state: 'open' - title: 'xxx' - body: 'xxxx' - update-mode: 'replace' - labels: 'xx' - assignees: 'xxx' - emoji: '+1' -``` - -| 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 | ✖ | -| state | Modify the status of issue, optional value `open` `closed` | string | ✖ | -| title | Modify the title of the issue | string | ✖ | -| body | Modify the content of issue | string | ✖ | -| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | -| labels | Replace the labels of issue | string | ✖ | -| assignees | Replace the assignees of issue | string | ✖ | -| emoji | Add [reaction](#emoji-types) | string | ✖ | - -- `state` defaults to `open` -- When the option is not filled, it will keep the original - -⏫ [Back to list](#List) - -### 🌟 Advanced - -Advanced usage is not recommended to use multiple actions at the same time. - -#### `check-inactive` - -At UTC 0 on the 1st of each month, add the `inactive` tag to all issues that have not been active for more than 30 days. - -```yml -name: Check inactive - -on: - schedule: - - cron: "0 0 1 * *" - -jobs: - check-inactive: - runs-on: ubuntu-latest - steps: - - name: check-inactive - uses: actions-cool/issues-helper@v3 - with: - actions: 'check-inactive' - token: ${{ secrets.GITHUB_TOKEN }} - inactive-day: 30 -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](#token) | string | ✖ | -| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | -| emoji | Add [reaction](#emoji-types) for this comment | string | ✖ | -| labels | Labels filtering | string | ✖ | -| issue-state | State filtering | string | ✖ | -| issue-assignee | Assignee filtering | string | ✖ | -| issue-creator | Creator filtering | string | ✖ | -| issue-mentioned | Mentioned filtering | string | ✖ | -| body-includes | Body filtering | string | ✖ | -| title-includes | Title filtering | string | ✖ | -| inactive-day | Inactive days filtering | number | ✖ | -| inactive-label | The label name adding | string | ✖ | -| exclude-labels | Exclude labels filtering | string | ✖ | - -- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all -- `issue-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all` -- `issue-assignee`: Multiplayer is not supported. If you do not enter or enter *, all will be searched. Entering `none` will query issues for which the specified person is not added -- `inactive-day`: When entering, it will filter the issue update time earlier than the current time minus the number of inactive days. If not entered, all -- `inactive-label`: The default is `inactive`, others can be customized. When the project does not contain the label, it will be created automatically -- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded - -⏫ [Back to list](#List) - -#### `check-issue` - -Check whether the issue meets the conditions according to the passed parameters and `issue-number`, and return a boolean value. - -The effect of the following example is: when an issue is newly opened, verify whether the current issue designator contains `x1` or `x2`. - -If one designated person is satisfied, the verification will pass, and at the same time, verify whether the title meets the conditions. - -[Check rules](#check-rules) - -```yml -name: Check Issue - -on: - issues: - types: [edited] - -jobs: - check-issue: - runs-on: ubuntu-latest - steps: - - name: check-issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'check-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - assignee-includes: 'x1,x2' - title-includes: 'x1,x2/y1,y2' -``` - -| 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 | ✖ | -| assignee-includes | Assignees contains check | string | ✖ | -| title-includes | Title contains check | string | ✖ | -| title-excludes | Check whether the title is empty after removing the default title | string | ✖ | -| body-includes | Body contains check | string | ✖ | - -- `title-includes` `body-includes` supports the format `x1,x2` or `x1,x2/y1,y2`. Only supports two levels -- Return `check-result`, due to yml reasons, the judgment condition is `if: steps.xxid.outputs.check-result =='true'` - -⏫ [Back to list](#List) - -#### `close-issues` - -Every 7 days at UTC 0, close the issues that have been filled with the `need info` label and have not been active for more than 7 days. - -```yml -name: Check need info - -on: - schedule: - - cron: "0 0 */7 * *" - -jobs: - check-need-info: - runs-on: ubuntu-latest - steps: - - name: close-issues - uses: actions-cool/issues-helper@v3 - with: - actions: 'close-issues' - token: ${{ secrets.GITHUB_TOKEN }} - labels: 'need info' - inactive-day: 7 -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](#token) | string | ✖ | -| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | -| emoji | Add [reaction](#emoji-types) for this comment | string | ✖ | -| labels | Labels filtering | string | ✖ | -| issue-assignee | Assignee filtering | string | ✖ | -| issue-creator | Creator filtering | string | ✖ | -| issue-mentioned | Mentioned filtering | string | ✖ | -| body-includes | Body filtering | string | ✖ | -| title-includes | Title filtering | string | ✖ | -| inactive-day | Inactive days filtering | number | ✖ | -| exclude-labels | Exclude labels filtering | string | ✖ | -| close-reason | Reason for closing. Default `not_planned`, another `completed` | string | ✖ | - -- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all -- `issue-assignee`: Multiplayer is not supported. If you do not enter or enter *, all will be searched. Entering `none` will query issues for which the specified person is not added -- `inactive-day`: When entering, it will filter the issue update time earlier than the current time minus the number of inactive days. If not entered, all -- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded - -⏫ [Back to list](#List) - -#### `find-comments` - -Find the current warehouse issue No. 1, the creator is k and the content contains the comment list of `this`. - -```yml -- name: Find comments - uses: actions-cool/issues-helper@v3 - with: - actions: 'find-comments' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: 1 - comment-auth: 'k' - body-includes: 'this' -``` - -| 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 | ✖ | -| comment-auth | Comment creator, all will be queried if not filled | string | ✖ | -| body-includes | Comment content includes filtering, no verification if not filled | string | ✖ | -| direction | Return `comments` sort | string | ✖ | - -- Return `comments` in the following format: - -```js -[ - {id: 1, auth: 'x', body: 'xxx', created: '', updated: ''}, - {id: 2, auth: 'x', body: 'xxx', created: '', updated: ''}, -] -``` - -- `direction` defaults to ascending order, only when `desc` is set, descending order will be returned -- The `created` `updated` in the returned array, determined by the environment, will be UTC +0 - -⏫ [Back to list](#List) - -#### `find-issues` - -Find the current repository, the creator is k , the title contains `this` , the body contains `that`, and the list of issues in the open state. - -```yml -- name: Find issues - uses: actions-cool/issues-helper@v3 - with: - actions: 'find-issues' - token: ${{ secrets.GITHUB_TOKEN }} - issue-creator: 'k' - issue-state: 'open' - title-includes: 'this' - body-includes: 'that' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](#token) | string | ✖ | -| issue-state | State filtering | string | ✖ | -| issue-creator | Creator filtering | string | ✖ | -| title-includes | Title filtering | string | ✖ | -| body-includes | Body filtering | string | ✖ | -| exclude-labels | Exclude labels filtering | string | ✖ | -| inactive-day | Inactive days filtering | number | ✖ | -| direction | Return sort | string | ✖ | - -- Returns `issues` in the following format: - -```js -[ - {number: 1, auth: 'x', body: 'xxx', body: 'xxx', state: 'open', created: '', updated: ''}, - {number: 2, auth: 'x', body: 'xxx', body: 'xxx', state: 'closed', created: '', updated: ''}, -] -``` - -- `direction` defaults to ascending order, only when `desc` is set, descending order will be returned -- The `created` `updated` in the returned array, determined by the environment, will be UTC +0 -- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded - -⏫ [Back to list](#List) - -#### `lock-issues` - -Every 3 months at UTC 0 on the 1st, lock all issues that have been filled with the `inactive` label and have not been active for more than 128 days. - -```yml -name: Lock inactive issues - -on: - schedule: - - cron: "0 0 1 */3 *" - -jobs: - lock-issues: - runs-on: ubuntu-latest - steps: - - name: lock-issues - uses: actions-cool/issues-helper@v3 - with: - actions: 'lock-issues' - token: ${{ secrets.GITHUB_TOKEN }} - labels: 'inactive' - inactive-day: 128 -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](#token) | string | ✖ | -| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | -| emoji | Add [reaction](#emoji-types) for this comment | string | ✖ | -| labels | Labels filtering | string | ✖ | -| issue-state | State filtering | string | ✖ | -| issue-assignee | Assignee filtering | string | ✖ | -| issue-creator | Creator filtering | string | ✖ | -| issue-mentioned | Mentioned filtering | string | ✖ | -| body-includes | Body filtering | string | ✖ | -| title-includes | Title filtering | string | ✖ | -| inactive-day | Inactive days filtering | number | ✖ | -| lock-reason | Reason for locking issue | string | ✖ | -| exclude-labels | Exclude labels filtering | string | ✖ | - -- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all -- `issue-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all` -- `issue-assignee`: Multiplayer is not supported. If you do not enter or enter *, all will be searched. Entering `none` will query issues for which the specified person is not added -- `inactive-day`: When entering, it will filter the issue update time earlier than the current time minus the number of inactive days. If not entered, all -- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded - -⏫ [Back to list](#List) - -#### `mark-assignees` - -Quickly assign person, only for the issue to add editor comments. - -```yml -name: Issue Mark Assignees - -on: - issue_comment: - types: [created, edited] - -jobs: - mark-assignees: - runs-on: ubuntu-latest - steps: - - name: mark-assignees - uses: actions-cool/issues-helper@v3 - with: - actions: 'mark-assignees' - token: ${{ secrets.GITHUB_TOKEN }} -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](#token) | string | ✖ | -| assign-command | Simple commands can be set, such as: `/a` | string | ✖ | -| require-permission | Permission required, default is `write` | string | ✖ | - -- `assign-command`: default `/assign` -- `require-permission`: Optional values are `admin`, `write`, `read`, `none` - - If the team member sets the `read` permission, it is `read` - - If the external Collaborator is set to `read` permission, it is `read` - - Ordinary users have `read` permission - - When set `write`, `admin` and `write` meet the conditions - -⏫ [Back to list](#List) - -#### `mark-duplicate` - -Quickly mark duplicate questions, only for issue new comments or edit comments. - -```yml -name: Issue Mark Duplicate - -on: - issue_comment: - types: [created, edited] - -jobs: - mark-duplicate: - runs-on: ubuntu-latest - steps: - - name: mark-duplicate - uses: actions-cool/issues-helper@v3 - with: - actions: 'mark-duplicate' - token: ${{ secrets.GITHUB_TOKEN }} -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](#token) | string | ✖ | -| duplicate-command | Simple commands can be set, such as: `/d` | string | ✖ | -| duplicate-labels | Add additional labels to this issue | string | ✖ | -| remove-labels | Set removable labels | string | ✖ | -| labels | Replace the labels of the issue | string | ✖ | -| emoji | Add [reaction](#emoji-types) for this comment | string | ✖ | -| close-issue | Whether to close the issue at the same time | string | ✖ | -| require-permission | Permission required, default is `write` | string | ✖ | -| close-reason | Reason for closing. Default `not_planned`, another `completed` | string | ✖ | - -- `duplicate-command`: When setting concise commands, while still supporting the original `Duplicate of`. Block content contains `?` -- `labels`: Highest priority -- `close-issue`: Both `true` or `'true'` can take effect -- `require-permission`: Optional values are `admin`, `write`, `read`, `none` - - If the team member sets the `read` permission, it is `read` - - If the external Collaborator is set to `read` permission, it is `read` - - Ordinary users have `read` permission - - When set `write`, `admin` and `write` meet the conditions - -⏫ [Back to list](#List) - -#### `welcome` - -When an issue is created, the user who created the issue for the first time is welcome. - -If the user is not creating for the first time, there is no operation. - -```yml -name: Issue Welcome - -on: - issues: - types: [opened] - -jobs: - issue-welcome: - runs-on: ubuntu-latest - steps: - - name: welcome - uses: actions-cool/issues-helper@v3 - with: - actions: 'welcome' - token: ${{ secrets.GITHUB_TOKEN }} - body: hi @${{ github.event.issue.user.login }}, welcome! - labels: 'welcome1, welcome2' - assignees: 'xx1' - issue-emoji: '+1, -1, eyes' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](#token) | string | ✖ | -| body | Comment on the welcome content, no comment if you leave it blank | string | ✖ | -| labels | Add labels to this issue | string | ✖ | -| assignees | Add assignees to this issue | string | ✖ | -| issue-emoji | Add [reaction](#emoji-types) to this issue| string | ✖ | - -- If these 4 options are not filled, no operation - -⏫ [Back to list](#List) - -## 🎁 Reference - -### token - -Need to have the person token with push permission. - -- [Personal token application](https://github.com/settings/tokens) - - Need to check `Full control of private repositories` -- Project add secrets - - Select settings, select secrets, select `New repository secret` - - `Name` is the same as in actions - - `Value` fill in the token just applied by the individual - -When the token is not filled in actions or input `${{ secrets.GITHUB_TOKEN }}`, it will default to `github-actions-bot`. [More](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow). - -⏫ [Back to list](#List) - -### GitHub Docs - -- [Workflow syntax for GitHub Actions](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#on) -- [Events that trigger workflows](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows) - -⏫ [Back to list](#List) - -### `outputs` use - -```yml -- name: Create issue - uses: actions-cool/issues-helper@v3 - id: createissue - with: - actions: 'create-issue' - token: ${{ secrets.GITHUB_TOKEN }} -- name: Check outputs - run: echo "Outputs issue_number is ${{ steps.createissue.outputs.issue-number }}" -``` - -More: - -1. https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs -2. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs - -⏫ [Back to list](#List) - -### Check rules - -```js -"title-includes": 'x1,x2' - -x1 -x2 - -"x1y3y2" true -"y2 x1" true -"x2" true -"x3" false -``` - -```js -"title-includes": 'x1,x2/y1,y2' - -x1 + y1 -x2 + y1 -x1 + y2 -x2 + y2 - -"x1y3y2" true -"y2 x1" true -"1x2y" false -"x1" false -``` - -⏫ [Back to list](#List) -### Emoji types - -| content | emoji | -| -- | -- | -| `+1` | 👍 | -| `-1` | 👎 | -| `laugh` | 😄 | -| `confused` | 😕 | -| `heart` | ❤️ | -| `hooray` | 🎉 | -| `rocket` | 🚀 | -| `eyes` | 👀 | - -⏫ [Back to list](#List) - -### `comment-id` - -Click the `···` icon in the upper right corner of a comment, select `Copy link`, and the number at the end of the url is `comment_id`. - -⏫ [Back to list](#List) - -## Actions Template - -- You can directly use this [GitHub Actions workflow template](https://github.com/actions-cool/.github) repositorie template -- Personal exercises and tests [Actions](https://github.com/actions-cool/test-issues-helper) repository -- Can also refer to the warehouse of [online users](#who-is-using) - -## LICENSE - -[MIT](https://github.com/actions-cool/issues-helper/blob/main/LICENSE) diff --git a/README.md b/README.md index f9bf3fc6..7ad9913a 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@

-

🤖 Issues 助手

+

🤖 Issues Helper

-一个轻松帮你自动管理 issues 的 GitHub Action +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/badge/marketplace-issues--helper-red?style=flat-square)](https://github.com/marketplace/actions/issues-helper) @@ -18,30 +18,30 @@ [![](https://img.shields.io/github/stars/actions-cool/issues-helper?style=flat-square)](https://github.com/actions-cool/issues-helper/stargazers) [![](https://img.shields.io/github/v/release/actions-cool/issues-helper?style=flat-square&color=orange)](https://github.com/actions-cool/issues-helper/releases) -[![](https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square&color=%23ff7875)](https://github.com/actions-cool/issues-helper/discussions) +[![](https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square&color=%2308979c)](https://github.com/actions-cool/issues-helper/discussions) [![](https://img.shields.io/github/license/actions-cool/issues-helper?style=flat-square)](https://github.com/actions-cool/issues-helper/blob/main/LICENSE)
-简体中文 | [English](./README.en-US.md) +English | [简体中文](README.zh-CN.md) -## 🔗 链接 +## 🔗 Link -- [在线文档](https://actions-cool.github.io/issues-helper/) -- [在线文档 v2 版本](https://actions-cool.github.io/issues-helper-2.x/) -- [更新日志](./CHANGELOG.md) +- [Online documentation](https://actions-cool.github.io/issues-helper) +- [Online v2 documentation](https://actions-cool.github.io/issues-helper-2.x/) +- [Changelog](./CHANGELOG.md) -## 😎 为什么用 GitHub Action? +## 😎 Why use GitHub Action? -1. 完全免费 -2. 全自动操作 -3. 托管于 GitHub 服务器,只要 GitHub 不宕机,它就不受影响 +1. Complete free +2. Fully automatic +3. Hosted on the GitHub server, as long as GitHub is not down, it is not affected -> Private 项目每月有 2000 次的限制,[具体查看](https://github.com/settings/billing)。Public 项目无限制。 +> Private projects have a limit of 2000 times per month. [Specific view](https://github.com/settings/billing). Public are unlimited. -## 谁在使用? +## Who is using? -欢迎在 [**这里**](https://github.com/actions-cool/issues-helper/issues/6) 留言。 +Please leave a message at [**here**](https://github.com/actions-cool/issues-helper/issues/6). @@ -205,31 +205,27 @@
-## 图标 +## Badge -如果觉得 actions-cool 能帮到你,欢迎复制到 README 中支持,推广给更多的项目:[![actions-cool](https://img.shields.io/badge/using-actions--cool-blue?style=flat-square)](https://github.com/actions-cool),[更多样式](https://github.com/actions-cool/issues-helper/issues/92)。 +If you think `actions-cool` can help you, please copy it to the README to support promotion and bring convenience to more repositories:[![actions-cool](https://img.shields.io/badge/using-actions--cool-blue?style=flat-square)](https://github.com/actions-cool). [More color see](https://github.com/actions-cool/issues-helper/issues/92). ``` [![actions-cool](https://img.shields.io/badge/using-actions--cool-blue?style=flat-square)](https://github.com/actions-cool) ``` -## ⚡ 反馈 +## ⚡ Feedback -非常欢迎你来尝试使用,并提出意见,你可以通过以下方式: +You are very welcome to try it out and put forward your comments. You can use the following methods: -- 通过 [Issue](https://github.com/actions-cool/issues-helper/issues) 报告 bug 或进行咨询 -- 通过 [Discussions](https://github.com/actions-cool/issues-helper/discussions) 进行讨论 -- 提交 [Pull Request](https://github.com/actions-cool/issues-helper/pulls) 改进 `issues-helper` 的代码 +- Report bugs or consult with [Issue](https://github.com/actions-cool/issues-helper/issues) +- Discuss via [Discussions](https://github.com/actions-cool/issues-helper/discussions) +- Submit [Pull Request](https://github.com/actions-cool/issues-helper/pulls) to improve the code of `issues-helper` -也欢迎加入 钉钉交流群 +## List -![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*-iuDSpF7QAQAAAAAAAAAAAAAARQnAQ) +When the following list does not have the features you want, you can submit it in [issues](https://github.com/actions-cool/issues-helper/issues). -## 列 表 - -当以下列表没有你想要的功能时,可以在 [issues](https://github.com/actions-cool/issues-helper/issues) 中提出。 - -- ⭐ 基 础 +- ⭐ Base - [`add-assignees`](#add-assignees) - [`add-labels`](#add-labels) - [`close-issue`](#close-issue) @@ -237,6 +233,7 @@ - [`create-issue`](#create-issue) - [`create-label`](#create-label) - [`delete-comment`](#delete-comment) + - [`get-issue`](#get-issue) - [`lock-issue`](#lock-issue) - [`open-issue`](#open-issue) - [`remove-assignees`](#remove-assignees) @@ -245,7 +242,7 @@ - [`unlock-issue`](#unlock-issue) - [`update-comment`](#update-comment) - [`update-issue`](#update-issue) -- 🌟 进 阶 +- 🌟 Advanced - [`check-inactive`](#check-inactive) - [`check-issue`](#check-issue) - [`close-issues`](#close-issues) @@ -256,15 +253,15 @@ - [`mark-duplicate`](#mark-duplicate) - [`welcome`](#welcome) -## 🚀 使 用 +## 🚀 Usage -### ⭐ 基 础 +### ⭐ Base -为了更好的展示功能,下面以实际场景举例,请灵活参考。 +In order to better display the function, the following is an example of the actual scene, please refer to it flexibly. #### `add-assignees` -当一个 issue 新增或修改时,将这个 issue 指定某人或多人。 +When an issue is added or modified, assign this issue to one or more people. ```yml name: Add Assigness @@ -287,26 +284,26 @@ jobs: random-to: 1 ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| assignees | 指定人。当不填或者为空字符时,不操作 | string | ✖ | -| random-to | 当设置时,会在 assignees 中随机选择 | number | ✖ | +| 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 | ✖ | +| assignees | Designated person. No operation when no input or empty character | string | ✖ | +| random-to | When set, it will be randomly selected in assignees | number | ✖ | -- `actions` 支持多个,需用逗号隔开。如:`add-assignees, add-labels` -- 其中的 `name` 可根据自行根据实际情况修改 -- [on 参考](#github-docs) -- `${{ github.event.issue.number }}` 表示当前 issue 编号,[更多参考](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events) -- `assignees` 支持多个,需用逗号隔开 -- assign 最多只能设定 10 个 +- `actions` support multiple and separated by comma. Like: `add-assignees,add-labels` +- The `name` can be modified according to the actual situation +- [Reference to on](#github-docs) +- `${{ github.event.issue.number }}` is the current issue. [More references](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events) +- `assignees` support multiple and separated by comma +- You can assign up to 10 people to each issue -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `add-labels` -当一个新增的 issue 内容不包含指定格式时,为这个 issue 添加 labels。 +When the content of a new issue does not contain the specified format, add labels for the issue. ```yml name: Add Labels @@ -326,23 +323,23 @@ jobs: actions: 'add-labels' token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} - labels: 'bug' or 'bug1, bug2' + labels: 'bug' or 'xx1,xx2' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| labels | 新增的 labels。当不填或者为空字符时,不新增 | string | ✖ | +| 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 | New labels. When it is not filled in or is empty character, do not add | string | ✖ | -- `labels` 支持多个,需用逗号隔开 +- `labels` support multiple and separated by comma -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `close-issue` -关闭指定 issue。 +Close the specified issue. ```yml - name: Close issue @@ -353,18 +350,18 @@ jobs: issue-number: xxx ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| close-reason | 关闭原因。默认`not_planned`未计划,`completed`完成 | string | ✖ | +| 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 | ✖ | +| close-reason | Reason for closing. Default `not_planned`, another `completed` | string | ✖ | -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `create-comment` -当新增一个指定 label 时,对该 issue 进行评论。 +When a designated label is added, comment on the issue. ```yml name: Create Comment @@ -385,30 +382,30 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | - Hello ${{ github.event.issue.user.login }}. Add some comments. + Hello @${{ github.event.issue.user.login }}. Add some comments. - 你好 ${{ github.event.issue.user.login }}。巴拉巴拉。 + 你好 @${{ github.event.issue.user.login }}。巴拉巴拉。 emoji: '+1' or '+1,heart' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| body | 新增评论的内容 | string | ✔ | -| emoji | 为新增评论的增加 [emoji](#emoji-类型) | string | ✖ | +| 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 | ✖ | +| body | Add comment content | string | ✔ | +| emoji | Add [emoji](#emoji-types) | string | ✖ | -- `body` 为空时,无操作 -- 返回 `comment-id`,可用于之后操作。[用法参考](#outputs-使用) -- `${{ github.event.issue.user.login }}` 表示该 issue 的创建者 -- `emoji` 支持多个,需用逗号隔开 +- No action when `body` is empty +- Return `comment-id`, which can be used for subsequent operations. [Usage reference](#outputs-use) +- `${{ github.event.issue.user.login }}` indicates the creator of the issue +- `emoji` support multiple and separated by comma -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `create-issue` -感觉新增 issue 使用场景不多。这里举例,每月 1 号 UTC 00:00 新增一个 issue。 +Here is an example, add an issue at UTC 00:00 on the 1st of every month. ```yml name: Create Issue @@ -433,25 +430,25 @@ jobs: emoji: '+1' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| title | 新增 issue 的标题 | string | ✔ | -| body | 新增 issue 的内容 | string | ✖ | -| labels | 为新增 issue 添加 labels | string | ✖ | -| assignees | 为新增 issue 添加 assignees | string | ✖ | -| random-to | 当设置时,会在 assignees 中随机选择 | number | ✖ | -| emoji | 为新增 issue 增加 [emoji](#emoji-types) | string | ✖ | +| actions | Action type | string | ✔ | +| token | [Token explain](#token) | string | ✖ | +| title | The title of the new issue | string | ✔ | +| body | The body of the new issue | string | ✖ | +| labels | The labels for the new issue | string | ✖ | +| assignees | The assignees for the new issue | string | ✖ | +| random-to | When set, it will be randomly selected in assignees | number | ✖ | +| emoji | Add [emoji](#emoji-types) | string | ✖ | -- `title` 为空时,无操作 -- 返回 `issue-number`,[用法参考](#outputs-使用) +- No action when `title` is empty +- Return `issue-number`. [Usage reference](#outputs-use) -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `create-label` -新增 label。若想批量维护 labels,[可查看](https://github.com/actions-cool/labels-helper)。 +Create label. If you want to maintain labels in batches, [see](https://github.com/actions-cool/labels-helper). ```yml - name: Create label @@ -464,22 +461,22 @@ jobs: label-desc: 'xx' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| label-name | 标签名称,支持 emoji | string | ✔ | -| label-color | 标签颜色,格式为 16 进制色码,不加 `#` | string | ✖ | -| label-desc | 标签描述 | string | ✖ | +| actions | Action type | string | ✔ | +| token | [Token explain](#token) | string | ✖ | +| label-name | Label name, emoji support | string | ✔ | +| label-color | Label color, the format is hexadecimal color code, without `#` | string | ✖ | +| label-desc | Label description | string | ✖ | -- `label-name`:若已存在,则无操作 -- `label-color`:默认为 `ededed` +- `label-name`: If it already exists, no operation +- `label-color`: Default is `ededed` -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `delete-comment` -根据 [`comment-id`](#comment-id) 删除指定评论。 +According to [`comment-id`](#comment-id) delete the specified comment. ```yml - name: Delete comment @@ -490,17 +487,38 @@ jobs: comment-id: xxx ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | +| -- | -- | -- | -- | +| actions | Action type | string | ✔ | +| token | [Token explain](#token) | string | ✖ | +| comment-id | The comment ID | number | ✔ | + +⏫ [Back to list](#List) + +#### `get-issue` + +Query issue information. + +```yml +- name: Get Issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'get-issue' + token: ${{ secrets.GITHUB_TOKEN }} +``` + +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| comment-id | 指定的 comment | number | ✔ | +| actions | Action type | string | ✔ | +| token | [Token explain](#token) | string | ✖ | + +- Return `issue-number` `issue-title` `issue-body` `issue-labels` `issue-assignees` `issue-state`. [Usage reference](#outputs-use) -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `lock-issue` -当新增 `invalid` label 时,对该 issue 进行锁定。 +When the `invalid` label is added, the issue is locked. ```yml name: Lock Issue @@ -522,20 +540,20 @@ jobs: issue-number: ${{ github.event.issue.number }} ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| lock-reason | 锁定 issue 的原因 | string | ✖ | +| 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 | ✖ | +| lock-reason | Reason for locking issue | string | ✖ | -- `lock-reason`:可选值有 `off-topic` `too heated` `resolved` `spam` +- `lock-reason`: Optional values are `off-topic` `too heated` `resolved` `spam` -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `open-issue` -打开指定 issue。 +Open the specified issue. ```yml - name: Open issue @@ -546,17 +564,17 @@ jobs: issue-number: xxx ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| 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 | ✖ | -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `remove-assignees` -移除 issue 指定人员。 +Remove the person designated by issue. ```yml - name: Remove assignees @@ -568,18 +586,18 @@ jobs: assignees: 'xx' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| assignees | 移除的指定人。当为空字符时,不进行移除 | string | ✔ | +| 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 | ✖ | +| assignees | Designated person removed. When it is an empty character, do not remove | string | ✔ | -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `remove-labels` -移除指定 labels。 +Remove the specified labels. ```yml - name: Remove labels @@ -591,20 +609,20 @@ jobs: labels: 'xx' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| labels | 移除的 labels。当为空字符时,不进行移除 | string | ✔ | +| 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 removed labels. When it is a blank character, do not remove | string | ✔ | -- `labels` 支持多个,如 `x1,x2,x3`,只会移除 issue 已添加的 labels +- `labels` supports multiple, such as `x1,x2,x3`, only the labels added by the issue will be removed -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `set-labels` -替换 issue 的 labels。 +Replace the labels of issue. ```yml - name: Set labels @@ -616,18 +634,18 @@ jobs: labels: 'xx' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| labels | labels 设置。当空字符时,会移除所有 | string | ✔ | +| 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 | labels set. When empty characters, will remove all | string | ✔ | -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `unlock-issue` -解锁指定 issue。 +Unlock the specified issue. ```yml - name: Unlock issue @@ -638,19 +656,19 @@ jobs: issue-number: ${{ github.event.issue.number }} ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| 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 | ✖ | -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `update-comment` -根据 [`comment-id`](#comment-id) 更新指定评论。 +Update the specified comment according to [`comment-id`](#comment-id). -下面的例子展示的是,为每个新增的 comment 增加 👀 。 +The following example shows that 👀 is added for each new comment. ```yml name: Add eyes to each comment @@ -672,23 +690,24 @@ jobs: emoji: 'eyes' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| comment-id | 指定的 comment | number | ✔ | -| body | 更新 comment 的内容 | string | ✖ | -| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ | -| emoji | 增加 [emoji](#emoji-types) | string | ✖ | +| actions | Action type | string | ✔ | +| token | [Token explain](#token) | string | ✖ | +| comment-id | The comment ID | number | ✔ | +| out-comments | The output of `find-comments`, if you find multiple, operate multiple | string | ✖ | +| body | Update the content of comment | string | ✖ | +| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | +| emoji | Add [reaction](#emoji-types) | string | ✖ | -- `body` 不填时,会保持原有 -- `update-mode` 为 `append` 时,会进行附加操作。非 `append` 都会进行替换。仅对 `body` 生效 +- When `body` is not entered, it will remain as it is +- When `update-mode` is `append`, additional operations will be performed. Anything other than `append` will be replaced. Only effective for `body` -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `update-issue` -根据 `issue-number` 更新指定 issue。 +Update the specified issue according to the `issue-number`. ```yml - name: Update issue @@ -706,31 +725,31 @@ jobs: emoji: '+1' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| state | 修改 issue 的状态,可选值 `open` `closed` | string | ✖ | -| title | 修改 issue 的标题 | string | ✖ | -| body | 修改 issue 的内容 | string | ✖ | -| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ | -| labels | 替换 issue 的 labels | string | ✖ | -| assignees | 替换 issue 的 assignees | string | ✖ | -| emoji | 增加 [emoji](#emoji-types) | string | ✖ | +| 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 | ✖ | +| state | Modify the status of issue, optional value `open` `closed` | string | ✖ | +| title | Modify the title of the issue | string | ✖ | +| body | Modify the content of issue | string | ✖ | +| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | +| labels | Replace the labels of issue | string | ✖ | +| assignees | Replace the assignees of issue | string | ✖ | +| emoji | Add [reaction](#emoji-types) | string | ✖ | -- `state` 默认为 `open` -- 当可选项不填时,会保持原有 +- `state` defaults to `open` +- When the option is not filled, it will keep the original -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) -### 🌟 进 阶 +### 🌟 Advanced -进阶用法不建议 actions 多个一次同时使用。 +Advanced usage is not recommended to use multiple actions at the same time. #### `check-inactive` -每月 1 号 UTC 0 时,对所有 30 天以上未活跃的 issues 增加 `inactive` 标签。 +At UTC 0 on the 1st of each month, add the `inactive` tag to all issues that have not been active for more than 30 days. ```yml name: Check inactive @@ -751,37 +770,41 @@ jobs: inactive-day: 30 ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | -| emoji | 为该评论增加 [emoji](#emoji-types) | string | ✖ | -| labels | 标签筛选 | string | ✖ | -| issue-state | 状态筛选 | string | ✖ | -| issue-assignee | 指定人筛选 | string | ✖ | -| issue-creator | 创建人筛选 | string | ✖ | -| issue-mentioned | 提及人筛选 | string | ✖ | -| body-includes | 包含内容筛选 | string | ✖ | -| title-includes | 包含标题筛选 | string | ✖ | -| inactive-day | 非活跃天数筛选 | number | ✖ | -| inactive-label | 新增标签名称 | string | ✖ | -| exclude-labels | 排除标签筛选 | string | ✖ | - -- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 -- `issue-state`:默认为 `open`。可选值 `all` `closed`,非这 2 项时,均为 `open` -- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues -- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 -- `inactive-label`:默认为 `inactive`,可自定义其他。当项目未包含该 label 时,会自动新建 -- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue - -⏫ [返回列表](#列-表) +| actions | Action type | string | ✔ | +| token | [Token explain](#token) | string | ✖ | +| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | +| emoji | Add [reaction](#emoji-types) for this comment | string | ✖ | +| labels | Labels filtering | string | ✖ | +| issue-state | State filtering | string | ✖ | +| issue-assignee | Assignee filtering | string | ✖ | +| issue-creator | Creator filtering | string | ✖ | +| issue-mentioned | Mentioned filtering | string | ✖ | +| body-includes | Body filtering | string | ✖ | +| title-includes | Title filtering | string | ✖ | +| inactive-day | Inactive days filtering | number | ✖ | +| inactive-label | The label name adding | string | ✖ | +| exclude-labels | Exclude labels filtering | string | ✖ | + +- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all +- `issue-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all` +- `issue-assignee`: Multiplayer is not supported. If you do not enter or enter *, all will be searched. Entering `none` will query issues for which the specified person is not added +- `inactive-day`: When entering, it will filter the issue update time earlier than the current time minus the number of inactive days. If not entered, all +- `inactive-label`: The default is `inactive`, others can be customized. When the project does not contain the label, it will be created automatically +- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded + +⏫ [Back to list](#List) #### `check-issue` -根据传入的参数和 `issue-number` 来检查该 issue 是否满足条件,返回一个布尔值。 +Check whether the issue meets the conditions according to the passed parameters and `issue-number`, and return a boolean value. -下面的例子效果是:当 issue 新开时,校验当前 issue 指定人是否包含 `x1` 或者 `x2`,满足一个指定人即可校验通过,同时校验标题是否满足条件,[校验规则](#校验规则)。 +The effect of the following example is: when an issue is newly opened, verify whether the current issue designator contains `x1` or `x2`. + +If one designated person is satisfied, the verification will pass, and at the same time, verify whether the title meets the conditions. + +[Check rules](#check-rules) ```yml name: Check Issue @@ -804,24 +827,24 @@ jobs: title-includes: 'x1,x2/y1,y2' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| assignee-includes | 是否包含指定人 | string | ✖ | -| title-includes | 标题包含校验 | string | ✖ | -| title-excludes | 检测标题移除默认 title 后是否为空 | string | ✖ | -| body-includes | 内容包含校验 | string | ✖ | +| 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 | ✖ | +| assignee-includes | Assignees contains check | string | ✖ | +| title-includes | Title contains check | string | ✖ | +| title-excludes | Check whether the title is empty after removing the default title | string | ✖ | +| body-includes | Body contains check | string | ✖ | -- `title-includes` `body-includes` 支持格式 `x1,x2` 或者 `x1,x2/y1,y2`。只支持两个层级 -- 返回 `check-result`,由于 yml 原因,判断条件为 `if: steps.xxid.outputs.check-result == 'true'` +- `title-includes` `body-includes` supports the format `x1,x2` or `x1,x2/y1,y2`. Only supports two levels +- Return `check-result`, due to yml reasons, the judgment condition is `if: steps.xxid.outputs.check-result =='true'` -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `close-issues` -每 7 天 UTC 0 时,关闭已填加 `need info` label 且 7 天以上未活跃的 issues。 +Every 7 days at UTC 0, close the issues that have been filled with the `need info` label and have not been active for more than 7 days. ```yml name: Check need info @@ -843,32 +866,32 @@ jobs: inactive-day: 7 ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | -| emoji | 为该评论增加 [emoji](#emoji-types) | string | ✖ | -| labels | 标签筛选 | string | ✖ | -| issue-assignee | 指定人筛选 | string | ✖ | -| issue-creator | 创建人筛选 | string | ✖ | -| issue-mentioned | 提及人筛选 | string | ✖ | -| body-includes | 包含内容筛选 | string | ✖ | -| title-includes | 包含标题筛选 | string | ✖ | -| inactive-day | 非活跃天数筛选 | number | ✖ | -| exclude-labels | 排除标签筛选 | string | ✖ | -| close-reason | 关闭原因。默认`not_planned`未计划,`completed`完成 | string | ✖ | - -- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 -- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues -- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 -- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue - -⏫ [返回列表](#列-表) +| actions | Action type | string | ✔ | +| token | [Token explain](#token) | string | ✖ | +| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | +| emoji | Add [reaction](#emoji-types) for this comment | string | ✖ | +| labels | Labels filtering | string | ✖ | +| issue-assignee | Assignee filtering | string | ✖ | +| issue-creator | Creator filtering | string | ✖ | +| issue-mentioned | Mentioned filtering | string | ✖ | +| body-includes | Body filtering | string | ✖ | +| title-includes | Title filtering | string | ✖ | +| inactive-day | Inactive days filtering | number | ✖ | +| exclude-labels | Exclude labels filtering | string | ✖ | +| close-reason | Reason for closing. Default `not_planned`, another `completed` | string | ✖ | + +- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all +- `issue-assignee`: Multiplayer is not supported. If you do not enter or enter *, all will be searched. Entering `none` will query issues for which the specified person is not added +- `inactive-day`: When entering, it will filter the issue update time earlier than the current time minus the number of inactive days. If not entered, all +- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded + +⏫ [Back to list](#List) #### `find-comments` -查找当前仓库 1 号 issue 中,创建者是 k ,内容包含 `this` 的评论列表。 +Find the current warehouse issue No. 1, the creator is k and the content contains the comment list of `this`. ```yml - name: Find comments @@ -881,16 +904,16 @@ jobs: body-includes: 'this' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| comment-auth | 评论创建者,不填时会查询所有 | string | ✖ | -| body-includes | 评论内容包含过滤,不填时无校验 | string | ✖ | -| direction | 返回 `comments` 排序 | string | ✖ | +| 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 | ✖ | +| comment-auth | Comment creator, all will be queried if not filled | string | ✖ | +| body-includes | Comment content includes filtering, no verification if not filled | string | ✖ | +| direction | Return `comments` sort | string | ✖ | -- 返回 `comments`,格式如下: +- Return `comments` in the following format: ```js [ @@ -899,14 +922,14 @@ jobs: ] ``` -- `direction` 默认为升序,只有设置 `desc` 时,会返回降序 -- 返回数组中 `created` `updated`,由所处环境决定,会是 UTC +0 +- `direction` defaults to ascending order, only when `desc` is set, descending order will be returned +- The `created` `updated` in the returned array, determined by the environment, will be UTC +0 -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `find-issues` -查找当前仓库,创建者是 k ,title 包含 `this` ,body 包含 `that`,打开状态的 issues 列表。 +Find the current repository, the creator is k , the title contains `this` , the body contains `that`, and the list of issues in the open state. ```yml - name: Find issues @@ -920,19 +943,19 @@ jobs: body-includes: 'that' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| issue-state | 状态筛选 | string | ✖ | -| issue-creator | 创建者筛选 | string | ✖ | -| title-includes | 标题包含过滤,不填时无校验 | string | ✖ | -| body-includes | 内容包含过滤,不填时无校验 | string | ✖ | -| exclude-labels | 排除标签筛选 | string | ✖ | -| inactive-day | 非活跃天数筛选 | number | ✖ | -| direction | 返回 `issues` 排序 | string | ✖ | - -- 返回 `issues`,格式如下: +| actions | Action type | string | ✔ | +| token | [Token explain](#token) | string | ✖ | +| issue-state | State filtering | string | ✖ | +| issue-creator | Creator filtering | string | ✖ | +| title-includes | Title filtering | string | ✖ | +| body-includes | Body filtering | string | ✖ | +| exclude-labels | Exclude labels filtering | string | ✖ | +| inactive-day | Inactive days filtering | number | ✖ | +| direction | Return sort | string | ✖ | + +- Returns `issues` in the following format: ```js [ @@ -941,15 +964,15 @@ jobs: ] ``` -- `direction` 默认为升序,只有设置 `desc` 时,会返回降序 -- 返回数组中 `created` `updated`,由所处环境决定,会是 UTC +0 -- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue +- `direction` defaults to ascending order, only when `desc` is set, descending order will be returned +- The `created` `updated` in the returned array, determined by the environment, will be UTC +0 +- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `lock-issues` -每 3 个月 1 号 UTC 0 时,锁定已填加 `inactive` label 且 128 天以上未活跃的所有 issues。 +Every 3 months at UTC 0 on the 1st, lock all issues that have been filled with the `inactive` label and have not been active for more than 128 days. ```yml name: Lock inactive issues @@ -971,34 +994,34 @@ jobs: inactive-day: 128 ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | -| emoji | 为该评论增加 [emoji](#emoji-types) | string | ✖ | -| labels | 标签筛选 | string | ✖ | -| issue-state | 状态筛选 | string | ✖ | -| issue-assignee | 指定人筛选 | string | ✖ | -| issue-creator | 创建人筛选 | string | ✖ | -| issue-mentioned | 提及人筛选 | string | ✖ | -| body-includes | 包含内容筛选 | string | ✖ | -| title-includes | 包含标题筛选 | string | ✖ | -| inactive-day | 非活跃天数筛选 | number | ✖ | -| lock-reason | 锁定 issue 的原因 | string | ✖ | -| exclude-labels | 排除标签筛选 | string | ✖ | - -- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 -- `issue-state`:默认为 `open`。可选值 `all` `closed`,非这 2 项时,均为 `open` -- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues -- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 -- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue - -⏫ [返回列表](#列-表) +| actions | Action type | string | ✔ | +| token | [Token explain](#token) | string | ✖ | +| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | +| emoji | Add [reaction](#emoji-types) for this comment | string | ✖ | +| labels | Labels filtering | string | ✖ | +| issue-state | State filtering | string | ✖ | +| issue-assignee | Assignee filtering | string | ✖ | +| issue-creator | Creator filtering | string | ✖ | +| issue-mentioned | Mentioned filtering | string | ✖ | +| body-includes | Body filtering | string | ✖ | +| title-includes | Title filtering | string | ✖ | +| inactive-day | Inactive days filtering | number | ✖ | +| lock-reason | Reason for locking issue | string | ✖ | +| exclude-labels | Exclude labels filtering | string | ✖ | + +- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all +- `issue-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all` +- `issue-assignee`: Multiplayer is not supported. If you do not enter or enter *, all will be searched. Entering `none` will query issues for which the specified person is not added +- `inactive-day`: When entering, it will filter the issue update time earlier than the current time minus the number of inactive days. If not entered, all +- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded + +⏫ [Back to list](#List) #### `mark-assignees` -快捷加指定人,仅作用于 issue 新增编辑评论。 +Quickly assign person, only for the issue to add editor comments. ```yml name: Issue Mark Assignees @@ -1018,25 +1041,25 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| assign-command | 可设置简洁命令,如:`/a` | string | ✖ | -| require-permission | 要求权限,默认为 `write` | string | ✖ | +| actions | Action type | string | ✔ | +| token | [Token explain](#token) | string | ✖ | +| assign-command | Simple commands can be set, such as: `/a` | string | ✖ | +| require-permission | Permission required, default is `write` | string | ✖ | -- `assign-command`:可设置简洁命令。默认:`/assign` -- `require-permission`:可选值有 `admin`,`write`,`read`,`none` - - 团队成员若设置 `read` 权限,则为 `read` - - 外部 Collaborator 若设置 `read` 权限,则为 `read` - - 普通用户为 `read` 权限 - - 当设置 `write` 后,`admin` 和 `write` 满足条件 +- `assign-command`: default `/assign` +- `require-permission`: Optional values are `admin`, `write`, `read`, `none` + - If the team member sets the `read` permission, it is `read` + - If the external Collaborator is set to `read` permission, it is `read` + - Ordinary users have `read` permission + - When set `write`, `admin` and `write` meet the conditions -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) #### `mark-duplicate` -快捷标记重复问题,仅作用于 issue 新增编辑评论。 +Quickly mark duplicate questions, only for issue new comments or edit comments. ```yml name: Issue Mark Duplicate @@ -1056,33 +1079,35 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| duplicate-command | 可设置简洁命令,如:`/d` | string | ✖ | -| duplicate-labels | 为该 issue 额外增加 labels | string | ✖ | -| remove-labels | 设置可移除的 labels | string | ✖ | -| labels | 替换该 issue 的 labels | string | ✖ | -| emoji | 为该评论的增加 [emoji](#emoji-types) | string | ✖ | -| close-issue | 是否同时关闭该 issue | string | ✖ | -| require-permission | 要求权限,默认为 `write` | string | ✖ | -| close-reason | 关闭原因。默认`not_planned`未计划,`completed`完成 | string | ✖ | - -- `duplicate-command`:当设置简洁命令时,同时仍支持原有 `Duplicate of`。屏蔽内容包含 `?` -- `labels`:优先级最高 -- `close-issue`:`true` 或 `'true'` 均可生效 -- `require-permission`:可选值有 `admin`,`write`,`read`,`none` - - 团队成员若设置 `read` 权限,则为 `read` - - 外部 Collaborator 若设置 `read` 权限,则为 `read` - - 普通用户为 `read` 权限 - - 当设置 `write` 后,`admin` 和 `write` 满足条件 - -⏫ [返回列表](#列-表) +| actions | Action type | string | ✔ | +| token | [Token explain](#token) | string | ✖ | +| duplicate-command | Simple commands can be set, such as: `/d` | string | ✖ | +| duplicate-labels | Add additional labels to this issue | string | ✖ | +| remove-labels | Set removable labels | string | ✖ | +| labels | Replace the labels of the issue | string | ✖ | +| emoji | Add [reaction](#emoji-types) for this comment | string | ✖ | +| close-issue | Whether to close the issue at the same time | string | ✖ | +| require-permission | Permission required, default is `write` | string | ✖ | +| close-reason | Reason for closing. Default `not_planned`, another `completed` | string | ✖ | + +- `duplicate-command`: When setting concise commands, while still supporting the original `Duplicate of`. Block content contains `?` +- `labels`: Highest priority +- `close-issue`: Both `true` or `'true'` can take effect +- `require-permission`: Optional values are `admin`, `write`, `read`, `none` + - If the team member sets the `read` permission, it is `read` + - If the external Collaborator is set to `read` permission, it is `read` + - Ordinary users have `read` permission + - When set `write`, `admin` and `write` meet the conditions + +⏫ [Back to list](#List) #### `welcome` -当一个 issue 新建时,对首次新建 issue 的用户进行欢迎。若用户非首次新建,则无操作。 +When an issue is created, the user who created the issue for the first time is welcome. + +If the user is not creating for the first time, there is no operation. ```yml name: Issue Welcome @@ -1106,45 +1131,44 @@ jobs: issue-emoji: '+1, -1, eyes' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](#token) | string | ✖ | -| body | 评论欢迎的内容,不填则不评论 | string | ✖ | -| emoji | 为该评论的增加 [emoji](#emoji-types) | string | ✖ | -| labels | 为该 issue 增加 labels | string | ✖ | -| assignees | 为该 issue 增加 assignees | string | ✖ | -| issue-emoji | 为该 issue 增加 [emoji](#emoji-types) | string | ✖ | +| actions | Action type | string | ✔ | +| token | [Token explain](#token) | string | ✖ | +| body | Comment on the welcome content, no comment if you leave it blank | string | ✖ | +| labels | Add labels to this issue | string | ✖ | +| assignees | Add assignees to this issue | string | ✖ | +| issue-emoji | Add [reaction](#emoji-types) to this issue| string | ✖ | -- 若这 4 个可选项都不填,则无操作 +- If these 4 options are not filled, no operation -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) -## 🎁 参 考 +## 🎁 Reference ### token -需拥有 push 权限的人员 token。 +Need to have the person token with push permission. -- [个人 token 申请](https://github.com/settings/tokens) - - 需勾选 `Full control of private repositories` -- 项目添加 secrets - - 选择 settings,选择 secrets,选择 `New repository secret` - - `Name` 与 actions 中保持一致 - - `Value` 填写刚才个人申请的 token +- [Personal token application](https://github.com/settings/tokens) + - Need to check `Full control of private repositories` +- Project add secrets + - Select settings, select secrets, select `New repository secret` + - `Name` is the same as in actions + - `Value` fill in the token just applied by the individual -当 actions 不填写 token 时,或填写 `${{ secrets.GITHUB_TOKEN }}`,会默认为 `github-actions-bot`。[更多查看](https://docs.github.com/en/actions/security-guides/automatic-token-authentication)。 +When the token is not filled in actions or input `${{ secrets.GITHUB_TOKEN }}`, it will default to `github-actions-bot`. [More](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow). -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) ### GitHub Docs -- [GitHub Actions 语法](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#about-yaml-syntax-for-workflows) -- [工作流触发机制](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows) +- [Workflow syntax for GitHub Actions](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#on) +- [Events that trigger workflows](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows) -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) -### `outputs` 使用 +### `outputs` use ```yml - name: Create issue @@ -1157,14 +1181,14 @@ jobs: run: echo "Outputs issue_number is ${{ steps.createissue.outputs.issue-number }}" ``` -更多查看: +More: 1. https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs 2. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) -### 校验规则 +### Check rules ```js "title-includes": 'x1,x2' @@ -1192,9 +1216,8 @@ x2 + y2 "x1" false ``` -⏫ [返回列表](#列-表) - -### emoji 类型 +⏫ [Back to list](#List) +### Emoji types | content | emoji | | -- | -- | @@ -1207,19 +1230,19 @@ x2 + y2 | `rocket` | 🚀 | | `eyes` | 👀 | -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) ### `comment-id` -点击某个评论右上角 `···` 图标,选择 `Copy link`,url 末尾数字即是 `comment_id`。 +Click the `···` icon in the upper right corner of a comment, select `Copy link`, and the number at the end of the url is `comment_id`. -⏫ [返回列表](#列-表) +⏫ [Back to list](#List) -## Actions 模板 +## Actions Template -- 可直接使用这个 [GitHub Actions workflow template](https://github.com/actions-cool/.github) 仓库的模板 -- 个人练习和测试 [Actions](https://github.com/actions-cool/test-issues-helper) 的仓库 -- 也可以来 [线上使用者](#谁在使用) 的仓库参照 +- You can directly use this [GitHub Actions workflow template](https://github.com/actions-cool/.github) repositorie template +- Personal exercises and tests [Actions](https://github.com/actions-cool/test-issues-helper) repository +- Can also refer to the warehouse of [online users](#who-is-using) ## LICENSE diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 00000000..52428cd8 --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,1248 @@ +

+ + + +

+ +

🤖 Issues 助手

+ +
+ +一个轻松帮你自动管理 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/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) +[![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) +[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) + +[![](https://img.shields.io/github/stars/actions-cool/issues-helper?style=flat-square)](https://github.com/actions-cool/issues-helper/stargazers) +[![](https://img.shields.io/github/v/release/actions-cool/issues-helper?style=flat-square&color=orange)](https://github.com/actions-cool/issues-helper/releases) +[![](https://img.shields.io/badge/discussions-on%20github-blue?style=flat-square&color=%23ff7875)](https://github.com/actions-cool/issues-helper/discussions) +[![](https://img.shields.io/github/license/actions-cool/issues-helper?style=flat-square)](https://github.com/actions-cool/issues-helper/blob/main/LICENSE) + +
+ +[English](README.md) | 简体中文 + +## 🔗 链接 + +- [在线文档](https://actions-cool.github.io/issues-helper/) +- [在线文档 v2 版本](https://actions-cool.github.io/issues-helper-2.x/) +- [更新日志](./CHANGELOG.md) + +## 😎 为什么用 GitHub Action? + +1. 完全免费 +2. 全自动操作 +3. 托管于 GitHub 服务器,只要 GitHub 不宕机,它就不受影响 + +> Private 项目每月有 2000 次的限制,[具体查看](https://github.com/settings/billing)。Public 项目无限制。 + +## 谁在使用? + +欢迎在 [**这里**](https://github.com/actions-cool/issues-helper/issues/6) 留言。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
ant-designant-design-blazorant-design-vuebootstrap
+ + + + + + + + + + + + + + + +
dumielement-plusformilyjsx-next
+ + + + + + + + + + + + + + + +
material-uinaive-uinutuiprettier
+ + + + + + + + + + + + + + + +
pro-componentsreact-componentreact-music-playerS2
+ + + + + + + + + + + + + + + +
swiperumivitevitest
+ + + + + + + + + + + +
vue-requestvuepress-nextzoo
+ +## 图标 + +如果觉得 actions-cool 能帮到你,欢迎复制到 README 中支持,推广给更多的项目:[![actions-cool](https://img.shields.io/badge/using-actions--cool-blue?style=flat-square)](https://github.com/actions-cool),[更多样式](https://github.com/actions-cool/issues-helper/issues/92)。 + +``` +[![actions-cool](https://img.shields.io/badge/using-actions--cool-blue?style=flat-square)](https://github.com/actions-cool) +``` + +## ⚡ 反馈 + +非常欢迎你来尝试使用,并提出意见,你可以通过以下方式: + +- 通过 [Issue](https://github.com/actions-cool/issues-helper/issues) 报告 bug 或进行咨询 +- 通过 [Discussions](https://github.com/actions-cool/issues-helper/discussions) 进行讨论 +- 提交 [Pull Request](https://github.com/actions-cool/issues-helper/pulls) 改进 `issues-helper` 的代码 + +也欢迎加入 钉钉交流群 + +![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*-iuDSpF7QAQAAAAAAAAAAAAAARQnAQ) + +## 列 表 + +当以下列表没有你想要的功能时,可以在 [issues](https://github.com/actions-cool/issues-helper/issues) 中提出。 + +- ⭐ 基 础 + - [`add-assignees`](#add-assignees) + - [`add-labels`](#add-labels) + - [`close-issue`](#close-issue) + - [`create-comment`](#create-comment) + - [`create-issue`](#create-issue) + - [`create-label`](#create-label) + - [`delete-comment`](#delete-comment) + - [`get-issue`](#get-issue) + - [`lock-issue`](#lock-issue) + - [`open-issue`](#open-issue) + - [`remove-assignees`](#remove-assignees) + - [`remove-labels`](#remove-labels) + - [`set-labels`](#set-labels) + - [`unlock-issue`](#unlock-issue) + - [`update-comment`](#update-comment) + - [`update-issue`](#update-issue) +- 🌟 进 阶 + - [`check-inactive`](#check-inactive) + - [`check-issue`](#check-issue) + - [`close-issues`](#close-issues) + - [`find-comments`](#find-comments) + - [`find-issues`](#find-issues) + - [`lock-issues`](#lock-issues) + - [`mark-assignees`](#mark-assignees) + - [`mark-duplicate`](#mark-duplicate) + - [`welcome`](#welcome) + +## 🚀 使 用 + +### ⭐ 基 础 + +为了更好的展示功能,下面以实际场景举例,请灵活参考。 + +#### `add-assignees` + +当一个 issue 新增或修改时,将这个 issue 指定某人或多人。 + +```yml +name: Add Assigness + +on: + issues: + types: [opened, edited] + +jobs: + add-assigness: + runs-on: ubuntu-latest + steps: + - name: Add assigness + uses: actions-cool/issues-helper@v3 + with: + actions: 'add-assignees' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + assignees: 'xxx' or 'xx1,xx2' + random-to: 1 +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| assignees | 指定人。当不填或者为空字符时,不操作 | string | ✖ | +| random-to | 当设置时,会在 assignees 中随机选择 | number | ✖ | + +- `actions` 支持多个,需用逗号隔开。如:`add-assignees, add-labels` +- 其中的 `name` 可根据自行根据实际情况修改 +- [on 参考](#github-docs) +- `${{ github.event.issue.number }}` 表示当前 issue 编号,[更多参考](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events) +- `assignees` 支持多个,需用逗号隔开 +- assign 最多只能设定 10 个 + +⏫ [返回列表](#列-表) + +#### `add-labels` + +当一个新增的 issue 内容不包含指定格式时,为这个 issue 添加 labels。 + +```yml +name: Add Labels + +on: + issues: + types: [opened] + +jobs: + add-labels: + runs-on: ubuntu-latest + if: contains(github.event.issue.body, 'xxx') == false + steps: + - name: Add labels + uses: actions-cool/issues-helper@v3 + with: + actions: 'add-labels' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + labels: 'bug' or 'bug1, bug2' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| labels | 新增的 labels。当不填或者为空字符时,不新增 | string | ✖ | + +- `labels` 支持多个,需用逗号隔开 + +⏫ [返回列表](#列-表) + +#### `close-issue` + +关闭指定 issue。 + +```yml +- name: Close issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'close-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: xxx +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| close-reason | 关闭原因。默认`not_planned`未计划,`completed`完成 | string | ✖ | + +⏫ [返回列表](#列-表) + +#### `create-comment` + +当新增一个指定 label 时,对该 issue 进行评论。 + +```yml +name: Create Comment + +on: + issues: + types: [labeled] + +jobs: + create-comment: + runs-on: ubuntu-latest + if: github.event.label.name == 'xxx' + steps: + - name: Create comment + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hello ${{ github.event.issue.user.login }}. Add some comments. + + 你好 ${{ github.event.issue.user.login }}。巴拉巴拉。 + emoji: '+1' or '+1,heart' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| body | 新增评论的内容 | string | ✔ | +| emoji | 为新增评论的增加 [emoji](#emoji-类型) | string | ✖ | + +- `body` 为空时,无操作 +- 返回 `comment-id`,可用于之后操作。[用法参考](#outputs-使用) +- `${{ github.event.issue.user.login }}` 表示该 issue 的创建者 +- `emoji` 支持多个,需用逗号隔开 + +⏫ [返回列表](#列-表) + +#### `create-issue` + +感觉新增 issue 使用场景不多。这里举例,每月 1 号 UTC 00:00 新增一个 issue。 + +```yml +name: Create Issue + +on: + schedule: + - cron: "0 0 1 * *" + +jobs: + create-issue: + runs-on: ubuntu-latest + steps: + - name: Create issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-issue' + token: ${{ secrets.GITHUB_TOKEN }} + title: 'xxxx' + body: 'xxxx' + labels: 'xx' + assignees: 'xxx' + emoji: '+1' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| title | 新增 issue 的标题 | string | ✔ | +| body | 新增 issue 的内容 | string | ✖ | +| labels | 为新增 issue 添加 labels | string | ✖ | +| assignees | 为新增 issue 添加 assignees | string | ✖ | +| random-to | 当设置时,会在 assignees 中随机选择 | number | ✖ | +| emoji | 为新增 issue 增加 [emoji](#emoji-types) | string | ✖ | + +- `title` 为空时,无操作 +- 返回 `issue-number`,[用法参考](#outputs-使用) + +⏫ [返回列表](#列-表) + +#### `create-label` + +新增 label。若想批量维护 labels,[可查看](https://github.com/actions-cool/labels-helper)。 + +```yml +- name: Create label + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-label' + token: ${{ secrets.GITHUB_TOKEN }} + label-name: 'xx' + label-color: '0095b3' + label-desc: 'xx' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| label-name | 标签名称,支持 emoji | string | ✔ | +| label-color | 标签颜色,格式为 16 进制色码,不加 `#` | string | ✖ | +| label-desc | 标签描述 | string | ✖ | + +- `label-name`:若已存在,则无操作 +- `label-color`:默认为 `ededed` + +⏫ [返回列表](#列-表) + +#### `delete-comment` + +根据 [`comment-id`](#comment-id) 删除指定评论。 + +```yml +- name: Delete comment + uses: actions-cool/issues-helper@v3 + with: + actions: 'delete-comment' + token: ${{ secrets.GITHUB_TOKEN }} + comment-id: xxx +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| comment-id | 指定的 comment | number | ✔ | + +⏫ [返回列表](#列-表) + +#### `get-issue` + +查询 issue 信息。 + +```yml +- name: Get Issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'get-issue' + token: ${{ secrets.GITHUB_TOKEN }} +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | + +- 返回 `issue-number` `issue-title` `issue-body` `issue-labels` `issue-assignees` `issue-state`,[用法参考](#outputs-使用) + +⏫ [返回列表](#列-表) + +#### `lock-issue` + +当新增 `invalid` label 时,对该 issue 进行锁定。 + +```yml +name: Lock Issue + +on: + issues: + types: [labeled] + +jobs: + lock-issue: + runs-on: ubuntu-latest + if: github.event.label.name == 'invalid' + steps: + - name: Lock issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'lock-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| lock-reason | 锁定 issue 的原因 | string | ✖ | + +- `lock-reason`:可选值有 `off-topic` `too heated` `resolved` `spam` + +⏫ [返回列表](#列-表) + +#### `open-issue` + +打开指定 issue。 + +```yml +- name: Open issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'open-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: xxx +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | + +⏫ [返回列表](#列-表) + +#### `remove-assignees` + +移除 issue 指定人员。 + +```yml +- name: Remove assignees + uses: actions-cool/issues-helper@v3 + with: + actions: 'remove-assignees' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + assignees: 'xx' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| assignees | 移除的指定人。当为空字符时,不进行移除 | string | ✔ | + +⏫ [返回列表](#列-表) + +#### `remove-labels` + +移除指定 labels。 + +```yml +- name: Remove labels + uses: actions-cool/issues-helper@v3 + with: + actions: 'remove-labels' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + labels: 'xx' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| labels | 移除的 labels。当为空字符时,不进行移除 | string | ✔ | + +- `labels` 支持多个,如 `x1,x2,x3`,只会移除 issue 已添加的 labels + +⏫ [返回列表](#列-表) + +#### `set-labels` + +替换 issue 的 labels。 + +```yml +- name: Set labels + uses: actions-cool/issues-helper@v3 + with: + actions: 'set-labels' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + labels: 'xx' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| labels | labels 设置。当空字符时,会移除所有 | string | ✔ | + +⏫ [返回列表](#列-表) + +#### `unlock-issue` + +解锁指定 issue。 + +```yml +- name: Unlock issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'unlock-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | + +⏫ [返回列表](#列-表) + +#### `update-comment` + +根据 [`comment-id`](#comment-id) 更新指定评论。 + +下面的例子展示的是,为每个新增的 comment 增加 👀 。 + +```yml +name: Add eyes to each comment + +on: + issue_comment: + types: [created] + +jobs: + update-comment: + runs-on: ubuntu-latest + steps: + - name: Update comment + uses: actions-cool/issues-helper@v3 + with: + actions: 'update-comment' + token: ${{ secrets.GITHUB_TOKEN }} + comment-id: ${{ github.event.comment.id }} + emoji: 'eyes' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| comment-id | 指定的 comment | number | ✔ | +| body | 更新 comment 的内容 | string | ✖ | +| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ | +| emoji | 增加 [emoji](#emoji-types) | string | ✖ | + +- `body` 不填时,会保持原有 +- `update-mode` 为 `append` 时,会进行附加操作。非 `append` 都会进行替换。仅对 `body` 生效 + +⏫ [返回列表](#列-表) + +#### `update-issue` + +根据 `issue-number` 更新指定 issue。 + +```yml +- name: Update issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'update-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + state: 'open' + title: 'xxx' + body: 'xxxx' + update-mode: 'replace' + labels: 'xx' + assignees: 'xxx' + emoji: '+1' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| state | 修改 issue 的状态,可选值 `open` `closed` | string | ✖ | +| title | 修改 issue 的标题 | string | ✖ | +| body | 修改 issue 的内容 | string | ✖ | +| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ | +| labels | 替换 issue 的 labels | string | ✖ | +| assignees | 替换 issue 的 assignees | string | ✖ | +| emoji | 增加 [emoji](#emoji-types) | string | ✖ | + +- `state` 默认为 `open` +- 当可选项不填时,会保持原有 + +⏫ [返回列表](#列-表) + +### 🌟 进 阶 + +进阶用法不建议 actions 多个一次同时使用。 + +#### `check-inactive` + +每月 1 号 UTC 0 时,对所有 30 天以上未活跃的 issues 增加 `inactive` 标签。 + +```yml +name: Check inactive + +on: + schedule: + - cron: "0 0 1 * *" + +jobs: + check-inactive: + runs-on: ubuntu-latest + steps: + - name: check-inactive + uses: actions-cool/issues-helper@v3 + with: + actions: 'check-inactive' + token: ${{ secrets.GITHUB_TOKEN }} + inactive-day: 30 +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | +| emoji | 为该评论增加 [emoji](#emoji-types) | string | ✖ | +| labels | 标签筛选 | string | ✖ | +| issue-state | 状态筛选 | string | ✖ | +| issue-assignee | 指定人筛选 | string | ✖ | +| issue-creator | 创建人筛选 | string | ✖ | +| issue-mentioned | 提及人筛选 | string | ✖ | +| body-includes | 包含内容筛选 | string | ✖ | +| title-includes | 包含标题筛选 | string | ✖ | +| inactive-day | 非活跃天数筛选 | number | ✖ | +| inactive-label | 新增标签名称 | string | ✖ | +| exclude-labels | 排除标签筛选 | string | ✖ | + +- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 +- `issue-state`:默认为 `open`。可选值 `all` `closed`,非这 2 项时,均为 `open` +- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues +- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 +- `inactive-label`:默认为 `inactive`,可自定义其他。当项目未包含该 label 时,会自动新建 +- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue + +⏫ [返回列表](#列-表) + +#### `check-issue` + +根据传入的参数和 `issue-number` 来检查该 issue 是否满足条件,返回一个布尔值。 + +下面的例子效果是:当 issue 新开时,校验当前 issue 指定人是否包含 `x1` 或者 `x2`,满足一个指定人即可校验通过,同时校验标题是否满足条件,[校验规则](#校验规则)。 + +```yml +name: Check Issue + +on: + issues: + types: [edited] + +jobs: + check-issue: + runs-on: ubuntu-latest + steps: + - name: check-issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'check-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + assignee-includes: 'x1,x2' + title-includes: 'x1,x2/y1,y2' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| assignee-includes | 是否包含指定人 | string | ✖ | +| title-includes | 标题包含校验 | string | ✖ | +| title-excludes | 检测标题移除默认 title 后是否为空 | string | ✖ | +| body-includes | 内容包含校验 | string | ✖ | + +- `title-includes` `body-includes` 支持格式 `x1,x2` 或者 `x1,x2/y1,y2`。只支持两个层级 +- 返回 `check-result`,由于 yml 原因,判断条件为 `if: steps.xxid.outputs.check-result == 'true'` + +⏫ [返回列表](#列-表) + +#### `close-issues` + +每 7 天 UTC 0 时,关闭已填加 `need info` label 且 7 天以上未活跃的 issues。 + +```yml +name: Check need info + +on: + schedule: + - cron: "0 0 */7 * *" + +jobs: + check-need-info: + runs-on: ubuntu-latest + steps: + - name: close-issues + uses: actions-cool/issues-helper@v3 + with: + actions: 'close-issues' + token: ${{ secrets.GITHUB_TOKEN }} + labels: 'need info' + inactive-day: 7 +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | +| emoji | 为该评论增加 [emoji](#emoji-types) | string | ✖ | +| labels | 标签筛选 | string | ✖ | +| issue-assignee | 指定人筛选 | string | ✖ | +| issue-creator | 创建人筛选 | string | ✖ | +| issue-mentioned | 提及人筛选 | string | ✖ | +| body-includes | 包含内容筛选 | string | ✖ | +| title-includes | 包含标题筛选 | string | ✖ | +| inactive-day | 非活跃天数筛选 | number | ✖ | +| exclude-labels | 排除标签筛选 | string | ✖ | +| close-reason | 关闭原因。默认`not_planned`未计划,`completed`完成 | string | ✖ | + +- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 +- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues +- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 +- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue + +⏫ [返回列表](#列-表) + +#### `find-comments` + +查找当前仓库 1 号 issue 中,创建者是 k ,内容包含 `this` 的评论列表。 + +```yml +- name: Find comments + uses: actions-cool/issues-helper@v3 + with: + actions: 'find-comments' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: 1 + comment-auth: 'k' + body-includes: 'this' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| comment-auth | 评论创建者,不填时会查询所有 | string | ✖ | +| body-includes | 评论内容包含过滤,不填时无校验 | string | ✖ | +| direction | 返回 `comments` 排序 | string | ✖ | + +- 返回 `comments`,格式如下: + +```js +[ + {id: 1, auth: 'x', body: 'xxx', created: '', updated: ''}, + {id: 2, auth: 'x', body: 'xxx', created: '', updated: ''}, +] +``` + +- `direction` 默认为升序,只有设置 `desc` 时,会返回降序 +- 返回数组中 `created` `updated`,由所处环境决定,会是 UTC +0 + +⏫ [返回列表](#列-表) + +#### `find-issues` + +查找当前仓库,创建者是 k ,title 包含 `this` ,body 包含 `that`,打开状态的 issues 列表。 + +```yml +- name: Find issues + uses: actions-cool/issues-helper@v3 + with: + actions: 'find-issues' + token: ${{ secrets.GITHUB_TOKEN }} + issue-creator: 'k' + issue-state: 'open' + title-includes: 'this' + body-includes: 'that' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| issue-state | 状态筛选 | string | ✖ | +| issue-creator | 创建者筛选 | string | ✖ | +| title-includes | 标题包含过滤,不填时无校验 | string | ✖ | +| body-includes | 内容包含过滤,不填时无校验 | string | ✖ | +| exclude-labels | 排除标签筛选 | string | ✖ | +| inactive-day | 非活跃天数筛选 | number | ✖ | +| direction | 返回 `issues` 排序 | string | ✖ | + +- 返回 `issues`,格式如下: + +```js +[ + {number: 1, auth: 'x', body: 'xxx', body: 'xxx', state: 'open', created: '', updated: ''}, + {number: 2, auth: 'x', body: 'xxx', body: 'xxx', state: 'closed', created: '', updated: ''}, +] +``` + +- `direction` 默认为升序,只有设置 `desc` 时,会返回降序 +- 返回数组中 `created` `updated`,由所处环境决定,会是 UTC +0 +- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue + +⏫ [返回列表](#列-表) + +#### `lock-issues` + +每 3 个月 1 号 UTC 0 时,锁定已填加 `inactive` label 且 128 天以上未活跃的所有 issues。 + +```yml +name: Lock inactive issues + +on: + schedule: + - cron: "0 0 1 */3 *" + +jobs: + lock-issues: + runs-on: ubuntu-latest + steps: + - name: lock-issues + uses: actions-cool/issues-helper@v3 + with: + actions: 'lock-issues' + token: ${{ secrets.GITHUB_TOKEN }} + labels: 'inactive' + inactive-day: 128 +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | +| emoji | 为该评论增加 [emoji](#emoji-types) | string | ✖ | +| labels | 标签筛选 | string | ✖ | +| issue-state | 状态筛选 | string | ✖ | +| issue-assignee | 指定人筛选 | string | ✖ | +| issue-creator | 创建人筛选 | string | ✖ | +| issue-mentioned | 提及人筛选 | string | ✖ | +| body-includes | 包含内容筛选 | string | ✖ | +| title-includes | 包含标题筛选 | string | ✖ | +| inactive-day | 非活跃天数筛选 | number | ✖ | +| lock-reason | 锁定 issue 的原因 | string | ✖ | +| exclude-labels | 排除标签筛选 | string | ✖ | + +- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 +- `issue-state`:默认为 `open`。可选值 `all` `closed`,非这 2 项时,均为 `open` +- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues +- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 +- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue + +⏫ [返回列表](#列-表) + +#### `mark-assignees` + +快捷加指定人,仅作用于 issue 新增编辑评论。 + +```yml +name: Issue Mark Assignees + +on: + issue_comment: + types: [created, edited] + +jobs: + mark-assignees: + runs-on: ubuntu-latest + steps: + - name: mark-assignees + uses: actions-cool/issues-helper@v3 + with: + actions: 'mark-assignees' + token: ${{ secrets.GITHUB_TOKEN }} +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| assign-command | 可设置简洁命令,如:`/a` | string | ✖ | +| require-permission | 要求权限,默认为 `write` | string | ✖ | + +- `assign-command`:可设置简洁命令。默认:`/assign` +- `require-permission`:可选值有 `admin`,`write`,`read`,`none` + - 团队成员若设置 `read` 权限,则为 `read` + - 外部 Collaborator 若设置 `read` 权限,则为 `read` + - 普通用户为 `read` 权限 + - 当设置 `write` 后,`admin` 和 `write` 满足条件 + +⏫ [返回列表](#列-表) + +#### `mark-duplicate` + +快捷标记重复问题,仅作用于 issue 新增编辑评论。 + +```yml +name: Issue Mark Duplicate + +on: + issue_comment: + types: [created, edited] + +jobs: + mark-duplicate: + runs-on: ubuntu-latest + steps: + - name: mark-duplicate + uses: actions-cool/issues-helper@v3 + with: + actions: 'mark-duplicate' + token: ${{ secrets.GITHUB_TOKEN }} +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| duplicate-command | 可设置简洁命令,如:`/d` | string | ✖ | +| duplicate-labels | 为该 issue 额外增加 labels | string | ✖ | +| remove-labels | 设置可移除的 labels | string | ✖ | +| labels | 替换该 issue 的 labels | string | ✖ | +| emoji | 为该评论的增加 [emoji](#emoji-types) | string | ✖ | +| close-issue | 是否同时关闭该 issue | string | ✖ | +| require-permission | 要求权限,默认为 `write` | string | ✖ | +| close-reason | 关闭原因。默认`not_planned`未计划,`completed`完成 | string | ✖ | + +- `duplicate-command`:当设置简洁命令时,同时仍支持原有 `Duplicate of`。屏蔽内容包含 `?` +- `labels`:优先级最高 +- `close-issue`:`true` 或 `'true'` 均可生效 +- `require-permission`:可选值有 `admin`,`write`,`read`,`none` + - 团队成员若设置 `read` 权限,则为 `read` + - 外部 Collaborator 若设置 `read` 权限,则为 `read` + - 普通用户为 `read` 权限 + - 当设置 `write` 后,`admin` 和 `write` 满足条件 + +⏫ [返回列表](#列-表) + +#### `welcome` + +当一个 issue 新建时,对首次新建 issue 的用户进行欢迎。若用户非首次新建,则无操作。 + +```yml +name: Issue Welcome + +on: + issues: + types: [opened] + +jobs: + issue-welcome: + runs-on: ubuntu-latest + steps: + - name: welcome + uses: actions-cool/issues-helper@v3 + with: + actions: 'welcome' + token: ${{ secrets.GITHUB_TOKEN }} + body: hi @${{ github.event.issue.user.login }}, welcome! + labels: 'welcome1, welcome2' + assignees: 'xx1' + issue-emoji: '+1, -1, eyes' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](#token) | string | ✖ | +| body | 评论欢迎的内容,不填则不评论 | string | ✖ | +| emoji | 为该评论的增加 [emoji](#emoji-types) | string | ✖ | +| labels | 为该 issue 增加 labels | string | ✖ | +| assignees | 为该 issue 增加 assignees | string | ✖ | +| issue-emoji | 为该 issue 增加 [emoji](#emoji-types) | string | ✖ | + +- 若这 4 个可选项都不填,则无操作 + +⏫ [返回列表](#列-表) + +## 🎁 参 考 + +### token + +需拥有 push 权限的人员 token。 + +- [个人 token 申请](https://github.com/settings/tokens) + - 需勾选 `Full control of private repositories` +- 项目添加 secrets + - 选择 settings,选择 secrets,选择 `New repository secret` + - `Name` 与 actions 中保持一致 + - `Value` 填写刚才个人申请的 token + +当 actions 不填写 token 时,或填写 `${{ secrets.GITHUB_TOKEN }}`,会默认为 `github-actions-bot`。[更多查看](https://docs.github.com/en/actions/security-guides/automatic-token-authentication)。 + +⏫ [返回列表](#列-表) + +### GitHub Docs + +- [GitHub Actions 语法](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#about-yaml-syntax-for-workflows) +- [工作流触发机制](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows) + +⏫ [返回列表](#列-表) + +### `outputs` 使用 + +```yml +- name: Create issue + uses: actions-cool/issues-helper@v3 + id: createissue + with: + actions: 'create-issue' + token: ${{ secrets.GITHUB_TOKEN }} +- name: Check outputs + run: echo "Outputs issue_number is ${{ steps.createissue.outputs.issue-number }}" +``` + +更多查看: + +1. https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs +2. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs + +⏫ [返回列表](#列-表) + +### 校验规则 + +```js +"title-includes": 'x1,x2' + +x1 +x2 + +"x1y3y2" true +"y2 x1" true +"x2" true +"x3" false +``` + +```js +"title-includes": 'x1,x2/y1,y2' + +x1 + y1 +x2 + y1 +x1 + y2 +x2 + y2 + +"x1y3y2" true +"y2 x1" true +"1x2y" false +"x1" false +``` + +⏫ [返回列表](#列-表) + +### emoji 类型 + +| content | emoji | +| -- | -- | +| `+1` | 👍 | +| `-1` | 👎 | +| `laugh` | 😄 | +| `confused` | 😕 | +| `heart` | ❤️ | +| `hooray` | 🎉 | +| `rocket` | 🚀 | +| `eyes` | 👀 | + +⏫ [返回列表](#列-表) + +### `comment-id` + +点击某个评论右上角 `···` 图标,选择 `Copy link`,url 末尾数字即是 `comment_id`。 + +⏫ [返回列表](#列-表) + +## Actions 模板 + +- 可直接使用这个 [GitHub Actions workflow template](https://github.com/actions-cool/.github) 仓库的模板 +- 个人练习和测试 [Actions](https://github.com/actions-cool/test-issues-helper) 的仓库 +- 也可以来 [线上使用者](#谁在使用) 的仓库参照 + +## LICENSE + +[MIT](https://github.com/actions-cool/issues-helper/blob/main/LICENSE) diff --git a/web/.umirc.ts b/web/.umirc.ts index 7e7f9cb1..bbc72da6 100644 --- a/web/.umirc.ts +++ b/web/.umirc.ts @@ -21,40 +21,40 @@ export default defineConfig({ base: `/${name}/`, publicPath: `/${name}/`, locales: [ - ['zh-CN', '中文'], ['en-US', 'English'], + ['zh-CN', '中文'], ], theme: { '@c-primary': '#1890ff', }, navs: { - 'zh-CN': [ - { title: '指 南', path: '/guide' }, - { title: '基 础', path: '/base' }, - { title: '进 阶', path: '/advanced' }, - { title: '更新日志', path: '/changelog' }, + 'en-US': [ + { title: 'Guide', path: '/guide' }, + { title: 'Base', path: '/base' }, + { title: 'Advanced', path: '/advanced' }, + { title: 'Changelog', path: '/changelog' }, { title: 'GitHub', path: 'https://github.com/actions-cool/issues-helper' }, ], - 'en-US': [ - { title: 'Guide', path: '/en-US/guide' }, - { title: 'Base', path: '/en-US/base' }, - { title: 'Advanced', path: '/en-US/advanced' }, - { title: 'Changelog', path: '/en-US/changelog' }, + 'zh-CN': [ + { title: '指 南', path: '/zh-CN/guide' }, + { title: '基 础', path: '/zh-CN/base' }, + { title: '进 阶', path: '/zh-CN/advanced' }, + { title: '更新日志', path: '/zh-CN/changelog' }, { title: 'GitHub', path: 'https://github.com/actions-cool/issues-helper' }, ], }, menus: { '/guide': [ { - title: '🍭 介 绍', + title: '🍭 Guide', children: ['/guide/index', '/guide/start'], }, { - title: '🎁 参 考', + title: '🎁 Reference', path: '/guide/ref', }, { - title: '🎗 记 录', + title: '🎗 Note', path: '/guide/note', }, { @@ -62,17 +62,17 @@ export default defineConfig({ path: '/guide/faq', }, ], - '/en-US/guide': [ + '/zh-CN/guide': [ { - title: '🍭 Guide', + title: '🍭 介 绍', children: ['/guide/index', '/guide/start'], }, { - title: '🎁 Reference', + title: '🎁 参 考', path: '/guide/ref', }, { - title: '🎗 Note', + title: '🎗 记 录', path: '/guide/note', }, { diff --git a/web/docs/advanced.en-US.md b/web/docs/advanced.en-US.md deleted file mode 100644 index b06838fb..00000000 --- a/web/docs/advanced.en-US.md +++ /dev/null @@ -1,391 +0,0 @@ ---- -toc: menu ---- - -# 🌟 Advanced - -Advanced usage is not recommended to use multiple actions at the same time. - -## `check-inactive` - -At UTC 0 on the 1st of each month, add the `inactive` tag to all issues that have not been active for more than 30 days. - -```yml -name: Check inactive - -on: - schedule: - - cron: "0 0 1 * *" - -jobs: - check-inactive: - runs-on: ubuntu-latest - steps: - - name: check-inactive - uses: actions-cool/issues-helper@v3 - with: - actions: 'check-inactive' - token: ${{ secrets.GITHUB_TOKEN }} - inactive-day: 30 -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | -| contents | Add [reaction](/en-US/guide/ref#-reactions-type) for this comment | string | ✖ | -| labels | Labels filtering | string | ✖ | -| issue-state | State filtering | string | ✖ | -| issue-assignee | Assignee filtering | string | ✖ | -| issue-creator | Creator filtering | string | ✖ | -| issue-mentioned | Mentioned filtering | string | ✖ | -| body-includes | Body filtering | string | ✖ | -| title-includes | Title filtering | string | ✖ | -| inactive-day | Inactive days filtering | number | ✖ | -| inactive-label | The label name adding | string | ✖ | -| exclude-labels | Exclude labels filtering | string | ✖ | - -- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all -- `issue-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all` -- `issue-assignee`: Multiplayer is not supported. If you do not enter or enter *, all will be searched. Entering `none` will query issues for which the specified person is not added -- `inactive-day`: When entering, it will filter the issue update time earlier than the current time minus the number of inactive days. If not entered, all -- `inactive-label`: The default is `inactive`, others can be customized. When the project does not contain the label, it will be created automatically -- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded - -## `check-issue` - -Check whether the issue meets the conditions according to the passed parameters and `issue-number`, and return a boolean value. - -The effect of the following example is: when an issue is newly opened, verify whether the current issue designator contains `x1` or `x2`. - -If one designated person is satisfied, the verification will pass, and at the same time, verify whether the title meets the conditions. - -[Check rules](/en-US/guide/ref#-includes-check-rules) - -```yml -name: Check Issue - -on: - issues: - types: [edited] - -jobs: - check-issue: - runs-on: ubuntu-latest - steps: - - name: check-issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'check-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - assignee-includes: 'x1,x2' - title-includes: 'x1,x2/y1,y2' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ | -| assignee-includes | Assignees contains check | string | ✖ | -| title-includes | Title contains check | string | ✖ | -| title-excludes | Check whether the title is empty after removing the default title | string | ✖ | -| body-includes | Body contains check | string | ✖ | - -- `title-includes` `body-includes` supports the format `x1,x2` or `x1,x2/y1,y2`. Only supports two levels -- Return `check-result`, due to yml reasons, the judgment condition is `if: steps.xxid.outputs.check-result =='true'` - -## `close-issues` - -Every 7 days at UTC 0, close the issues that have been filled with the `need info` label and have not been active for more than 7 days. - -```yml -name: Check need info - -on: - schedule: - - cron: "0 0 */7 * *" - -jobs: - check-need-info: - runs-on: ubuntu-latest - steps: - - name: close-issues - uses: actions-cool/issues-helper@v3 - with: - actions: 'close-issues' - token: ${{ secrets.GITHUB_TOKEN }} - labels: 'need info' - inactive-day: 7 -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | -| contents | Add [reaction](/en-US/guide/ref#-reactions-type) for this comment | string | ✖ | -| labels | Labels filtering | string | ✖ | -| issue-assignee | Assignee filtering | string | ✖ | -| issue-creator | Creator filtering | string | ✖ | -| issue-mentioned | Mentioned filtering | string | ✖ | -| body-includes | Body filtering | string | ✖ | -| title-includes | Title filtering | string | ✖ | -| inactive-day | Inactive days filtering | number | ✖ | -| exclude-labels | Exclude labels filtering | string | ✖ | -| close-reason | Reason for closing. Default `not_planned`, another `completed` | string | ✖ | - -- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all -- `issue-assignee`: Multiplayer is not supported. If you do not enter or enter *, all will be searched. Entering `none` will query issues for which the specified person is not added -- `inactive-day`: When entering, it will filter the issue update time earlier than the current time minus the number of inactive days. If not entered, all -- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded - -## `find-comments` - -Find the current warehouse issue No. 1, the creator is k and the content contains the comment list of `this`. - -```yml -- name: Find comments - uses: actions-cool/issues-helper@v3 - with: - actions: 'find-comments' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: 1 - comment-auth: 'k' - body-includes: 'this' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ | -| comment-auth | Comment creator, all will be queried if not filled | string | ✖ | -| body-includes | Comment content includes filtering, no verification if not filled | string | ✖ | -| direction | Return `comments` sort | string | ✖ | - -- Return `comments` in the following format: - -```js -[ - {id: 1, auth: 'x', body: 'xxx', created: '', updated: ''}, - {id: 2, auth: 'x', body: 'xxx', created: '', updated: ''}, -] -``` - -- `direction` defaults to ascending order, only when `desc` is set, descending order will be returned -- The `created` `updated` in the returned array, determined by the environment, will be UTC +0 -## `find-issues` - -Find the current repository, the creator is k , the title contains `this` , the body contains `that`, and the list of issues in the open state. - -```yml -- name: Find issues - uses: actions-cool/issues-helper@v3 - with: - actions: 'find-issues' - token: ${{ secrets.GITHUB_TOKEN }} - issue-creator: 'k' - issue-state: 'open' - title-includes: 'this' - body-includes: 'that' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-state | State filtering | string | ✖ | -| issue-creator | Creator filtering | string | ✖ | -| title-includes | Title filtering | string | ✖ | -| body-includes | Body filtering | string | ✖ | -| exclude-labels | Exclude labels filtering | string | ✖ | -| inactive-day | Inactive days filtering | number | ✖ | -| direction | Return sort | string | ✖ | - -- Returns `issues` in the following format: - -```js -[ - {number: 1, auth: 'x', body: 'xxx', body: 'xxx', state: 'open', created: '', updated: ''}, - {number: 2, auth: 'x', body: 'xxx', body: 'xxx', state: 'closed', created: '', updated: ''}, -] -``` - -- `direction` defaults to ascending order, only when `desc` is set, descending order will be returned -- The `created` `updated` in the returned array, determined by the environment, will be UTC +0 -- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded - -## `lock-issues` - -Every 3 months at UTC 0 on the 1st, lock all issues that have been filled with the `inactive` label and have not been active for more than 128 days. - -```yml -name: Lock inactive issues - -on: - schedule: - - cron: "0 0 1 */3 *" - -jobs: - lock-issues: - runs-on: ubuntu-latest - steps: - - name: lock-issues - uses: actions-cool/issues-helper@v3 - with: - actions: 'lock-issues' - token: ${{ secrets.GITHUB_TOKEN }} - labels: 'inactive' - inactive-day: 128 -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | -| contents | Add [reaction](/en-US/guide/ref#-reactions-type) for this comment | string | ✖ | -| labels | Labels filtering | string | ✖ | -| issue-state | State filtering | string | ✖ | -| issue-assignee | Assignee filtering | string | ✖ | -| issue-creator | Creator filtering | string | ✖ | -| issue-mentioned | Mentioned filtering | string | ✖ | -| body-includes | Body filtering | string | ✖ | -| title-includes | Title filtering | string | ✖ | -| inactive-day | Inactive days filtering | number | ✖ | -| lock-reason | Reason for locking issue | string | ✖ | -| exclude-labels | Exclude labels filtering | string | ✖ | - -- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all -- `issue-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all` -- `issue-assignee`: Multiplayer is not supported. If you do not enter or enter *, all will be searched. Entering `none` will query issues for which the specified person is not added -- `inactive-day`: When entering, it will filter the issue update time earlier than the current time minus the number of inactive days. If not entered, all -- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded - -## `mark-assignees` - -Quickly assign person, only for the issue to add editor comments. - -```yml -name: Issue Mark Assignees - -on: - issue_comment: - types: [created, edited] - -jobs: - mark-assignees: - runs-on: ubuntu-latest - steps: - - name: mark-assignees - uses: actions-cool/issues-helper@v3 - with: - actions: 'mark-assignees' - token: ${{ secrets.GITHUB_TOKEN }} -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| assign-command | Simple commands can be set, such as: `/a` | string | ✖ | -| require-permission | Permission required, default is `write` | string | ✖ | - -- `assign-command`: default `/assign` -- `require-permission`: Optional values are `admin`, `write`, `read`, `none` - - If the team member sets the `read` permission, it is `read` - - If the external Collaborator is set to `read` permission, it is `read` - - Ordinary users have `read` permission - - When set `write`, `admin` and `write` meet the conditions - -## `mark-duplicate` - -Quickly mark duplicate questions, only for issue new comments or edit comments. - -```yml -name: Issue Mark Duplicate - -on: - issue_comment: - types: [created, edited] - -jobs: - mark-duplicate: - runs-on: ubuntu-latest - steps: - - name: mark-duplicate - uses: actions-cool/issues-helper@v3 - with: - actions: 'mark-duplicate' - token: ${{ secrets.GITHUB_TOKEN }} -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| duplicate-command | Simple commands can be set, such as: `/d` | string | ✖ | -| duplicate-labels | Add additional labels to this issue | string | ✖ | -| remove-labels | Set removable labels | string | ✖ | -| labels | Replace the labels of the issue | string | ✖ | -| emoji | Add [emoji](/en-US/guide/ref#-emoji-type) for this comment | string | ✖ | -| close-issue | Whether to close the issue at the same time | string | ✖ | -| require-permission | Permission required, default is `write` | string | ✖ | -| close-reason | Reason for closing. Default `not_planned`, another `completed` | string | ✖ | - -- `duplicate-command`: When setting concise commands, while still supporting the original `Duplicate of`. Block content contains `?` -- `labels`: Highest priority -- `close-issue`: Both `true` or `'true'` can take effect -- `require-permission`: Optional values are `admin`, `write`, `read`, `none` - - If the team member sets the `read` permission, it is `read` - - If the external Collaborator is set to `read` permission, it is `read` - - Ordinary users have `read` permission - - When set `write`, `admin` and `write` meet the conditions - - -Note: Duplicate created with the concise command does not display the content of the red box in the figure below. But in fact this has no effect. - - -![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*PN2tS7PjDQ4AAAAAAAAAAAAAARQnAQ) - -## `welcome` - -When an issue is created, the user who created the issue for the first time is welcome. - -If the user is not creating for the first time, there is no operation. - -```yml -name: Issue Welcome - -on: - issues: - types: [opened] - -jobs: - issue-welcome: - runs-on: ubuntu-latest - steps: - - name: welcome - uses: actions-cool/issues-helper@v3 - with: - actions: 'welcome' - token: ${{ secrets.GITHUB_TOKEN }} - body: hi @${{ github.event.issue.user.login }}, welcome! - labels: 'welcome1, welcome2' - assignees: 'xx1' - issue-emoji: '+1, -1, eyes' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| body | Comment on the welcome content, no comment if you leave it blank | string | ✖ | -| labels | Add labels to this issue | string | ✖ | -| assignees | Add assignees to this issue | string | ✖ | -| issue-emoji | Add [emoji](/en-US/guide/ref#-emoji-type) to this issue| string | ✖ | - -- If these 4 options are not filled, no operation diff --git a/web/docs/advanced.md b/web/docs/advanced.md index 40143eb1..aa435b2a 100644 --- a/web/docs/advanced.md +++ b/web/docs/advanced.md @@ -2,13 +2,13 @@ toc: menu --- -# 🌟 进 阶 +# 🌟 Advanced -进阶用法不建议 actions 多个一次同时使用。 +Advanced usage is not recommended to use multiple actions at the same time. ## `check-inactive` -每月 1 号 UTC 0 时,对所有 30 天以上未活跃的 issues 增加 `inactive` 标签。 +At UTC 0 on the 1st of each month, add the `inactive` tag to all issues that have not been active for more than 30 days. ```yml name: Check inactive @@ -29,35 +29,39 @@ jobs: inactive-day: 30 ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | -| emoji | 为该评论增加 [emoji](/guide/ref#-emoji-类型) | string | ✖ | -| labels | 标签筛选 | string | ✖ | -| issue-state | 状态筛选 | string | ✖ | -| issue-assignee | 指定人筛选 | string | ✖ | -| issue-creator | 创建人筛选 | string | ✖ | -| issue-mentioned | 提及人筛选 | string | ✖ | -| body-includes | 包含内容筛选 | string | ✖ | -| title-includes | 包含标题筛选 | string | ✖ | -| inactive-day | 非活跃天数筛选 | number | ✖ | -| inactive-label | 新增标签名称 | string | ✖ | -| exclude-labels | 排除标签筛选 | string | ✖ | - -- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 -- `issue-state`:默认为 `all`。可选值 `open` `closed`,非这 2 项时,均为 `all` -- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues -- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 -- `inactive-label`:默认为 `inactive`,可自定义其他。当项目未包含该 label 时,会自动新建 -- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue +| actions | Action type | string | ✔ | +| token | [Token explain](/guide/ref#-token) | string | ✖ | +| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | +| contents | Add [reaction](/guide/ref#-reactions-type) for this comment | string | ✖ | +| labels | Labels filtering | string | ✖ | +| issue-state | State filtering | string | ✖ | +| issue-assignee | Assignee filtering | string | ✖ | +| issue-creator | Creator filtering | string | ✖ | +| issue-mentioned | Mentioned filtering | string | ✖ | +| body-includes | Body filtering | string | ✖ | +| title-includes | Title filtering | string | ✖ | +| inactive-day | Inactive days filtering | number | ✖ | +| inactive-label | The label name adding | string | ✖ | +| exclude-labels | Exclude labels filtering | string | ✖ | + +- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all +- `issue-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all` +- `issue-assignee`: Multiplayer is not supported. If you do not enter or enter *, all will be searched. Entering `none` will query issues for which the specified person is not added +- `inactive-day`: When entering, it will filter the issue update time earlier than the current time minus the number of inactive days. If not entered, all +- `inactive-label`: The default is `inactive`, others can be customized. When the project does not contain the label, it will be created automatically +- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded ## `check-issue` -根据传入的参数和 `issue-number` 来检查该 issue 是否满足条件,返回一个布尔值。 +Check whether the issue meets the conditions according to the passed parameters and `issue-number`, and return a boolean value. -下面的例子效果是:当 issue 新开时,校验当前 issue 指定人是否包含 `x1` 或者 `x2`,满足一个指定人即可校验通过,同时校验标题是否满足条件,[校验规则](/guide/ref#-includes-校验规则)。 +The effect of the following example is: when an issue is newly opened, verify whether the current issue designator contains `x1` or `x2`. + +If one designated person is satisfied, the verification will pass, and at the same time, verify whether the title meets the conditions. + +[Check rules](/guide/ref#-includes-check-rules) ```yml name: Check Issue @@ -80,22 +84,22 @@ jobs: title-includes: 'x1,x2/y1,y2' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| assignee-includes | 是否包含指定人 | string | ✖ | -| title-includes | 标题包含校验 | string | ✖ | -| title-excludes | 检测标题移除默认 title 后是否为空 | string | ✖ | -| body-includes | 内容包含校验 | string | ✖ | +| 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 | ✖ | +| assignee-includes | Assignees contains check | string | ✖ | +| title-includes | Title contains check | string | ✖ | +| title-excludes | Check whether the title is empty after removing the default title | string | ✖ | +| body-includes | Body contains check | string | ✖ | -- `title-includes` `body-includes` 支持格式 `x1,x2` 或者 `x1,x2/y1,y2`。只支持两个层级 -- 返回 `check-result`,由于 yml 原因,判断条件为 `if: steps.xxid.outputs.check-result == 'true'` +- `title-includes` `body-includes` supports the format `x1,x2` or `x1,x2/y1,y2`. Only supports two levels +- Return `check-result`, due to yml reasons, the judgment condition is `if: steps.xxid.outputs.check-result =='true'` ## `close-issues` -每 7 天 UTC 0 时,关闭已填加 `need info` label 且 7 天以上未活跃的 issues。 +Every 7 days at UTC 0, close the issues that have been filled with the `need info` label and have not been active for more than 7 days. ```yml name: Check need info @@ -117,30 +121,30 @@ jobs: inactive-day: 7 ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | -| emoji | 为该评论增加 [emoji](/guide/ref#-emoji-类型) | string | ✖ | -| labels | 标签筛选 | string | ✖ | -| issue-assignee | 指定人筛选 | string | ✖ | -| issue-creator | 创建人筛选 | string | ✖ | -| issue-mentioned | 提及人筛选 | string | ✖ | -| body-includes | 包含内容筛选 | string | ✖ | -| title-includes | 包含标题筛选 | string | ✖ | -| inactive-day | 非活跃天数筛选 | number | ✖ | -| exclude-labels | 排除标签筛选 | string | ✖ | -| close-reason | 关闭原因。默认`not_planned`未计划,`completed`完成 | string | ✖ | - -- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 -- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues -- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 -- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue +| actions | Action type | string | ✔ | +| token | [Token explain](/guide/ref#-token) | string | ✖ | +| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | +| contents | Add [reaction](/guide/ref#-reactions-type) for this comment | string | ✖ | +| labels | Labels filtering | string | ✖ | +| issue-assignee | Assignee filtering | string | ✖ | +| issue-creator | Creator filtering | string | ✖ | +| issue-mentioned | Mentioned filtering | string | ✖ | +| body-includes | Body filtering | string | ✖ | +| title-includes | Title filtering | string | ✖ | +| inactive-day | Inactive days filtering | number | ✖ | +| exclude-labels | Exclude labels filtering | string | ✖ | +| close-reason | Reason for closing. Default `not_planned`, another `completed` | string | ✖ | + +- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all +- `issue-assignee`: Multiplayer is not supported. If you do not enter or enter *, all will be searched. Entering `none` will query issues for which the specified person is not added +- `inactive-day`: When entering, it will filter the issue update time earlier than the current time minus the number of inactive days. If not entered, all +- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded ## `find-comments` -查找当前仓库 1 号 issue 中,创建者是 k ,内容包含 `this` 的评论列表。 +Find the current warehouse issue No. 1, the creator is k and the content contains the comment list of `this`. ```yml - name: Find comments @@ -153,16 +157,16 @@ jobs: body-includes: 'this' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| comment-auth | 评论创建者,不填时会查询所有 | string | ✖ | -| body-includes | 评论内容包含过滤,不填时无校验 | string | ✖ | -| direction | 返回 `comments` 排序 | string | ✖ | +| 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 | ✖ | +| comment-auth | Comment creator, all will be queried if not filled | string | ✖ | +| body-includes | Comment content includes filtering, no verification if not filled | string | ✖ | +| direction | Return `comments` sort | string | ✖ | -- 返回 `comments`,格式如下: +- Return `comments` in the following format: ```js [ @@ -171,12 +175,11 @@ jobs: ] ``` -- `direction` 默认为升序,只有设置 `desc` 时,会返回降序 -- 返回数组中 `created` `updated`,由所处环境决定,会是 UTC +0 - +- `direction` defaults to ascending order, only when `desc` is set, descending order will be returned +- The `created` `updated` in the returned array, determined by the environment, will be UTC +0 ## `find-issues` -查找当前仓库,创建者是 k ,title 包含 `this` ,body 包含 `that`,打开状态的 issues 列表。 +Find the current repository, the creator is k , the title contains `this` , the body contains `that`, and the list of issues in the open state. ```yml - name: Find issues @@ -190,19 +193,19 @@ jobs: body-includes: 'that' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-state | 状态筛选 | string | ✖ | -| issue-creator | 创建者筛选 | string | ✖ | -| title-includes | 标题包含过滤,不填时无校验 | string | ✖ | -| body-includes | 内容包含过滤,不填时无校验 | string | ✖ | -| exclude-labels | 排除标签筛选 | string | ✖ | -| inactive-day | 非活跃天数筛选 | number | ✖ | -| direction | 返回 `issues` 排序 | string | ✖ | - -- 返回 `issues`,格式如下: +| actions | Action type | string | ✔ | +| token | [Token explain](/guide/ref#-token) | string | ✖ | +| issue-state | State filtering | string | ✖ | +| issue-creator | Creator filtering | string | ✖ | +| title-includes | Title filtering | string | ✖ | +| body-includes | Body filtering | string | ✖ | +| exclude-labels | Exclude labels filtering | string | ✖ | +| inactive-day | Inactive days filtering | number | ✖ | +| direction | Return sort | string | ✖ | + +- Returns `issues` in the following format: ```js [ @@ -211,13 +214,13 @@ jobs: ] ``` -- `direction` 默认为升序,只有设置 `desc` 时,会返回降序 -- 返回数组中 `created` `updated`,由所处环境决定,会是 UTC +0 -- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue +- `direction` defaults to ascending order, only when `desc` is set, descending order will be returned +- The `created` `updated` in the returned array, determined by the environment, will be UTC +0 +- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded ## `lock-issues` -每 3 个月 1 号 UTC 0 时,锁定已填加 `inactive` label 且 128 天以上未活跃的所有 issues。 +Every 3 months at UTC 0 on the 1st, lock all issues that have been filled with the `inactive` label and have not been active for more than 128 days. ```yml name: Lock inactive issues @@ -239,32 +242,32 @@ jobs: inactive-day: 128 ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | -| emoji | 为该评论增加 [emoji](/guide/ref#-emoji-类型) | string | ✖ | -| labels | 标签筛选 | string | ✖ | -| issue-state | 状态筛选 | string | ✖ | -| issue-assignee | 指定人筛选 | string | ✖ | -| issue-creator | 创建人筛选 | string | ✖ | -| issue-mentioned | 提及人筛选 | string | ✖ | -| body-includes | 包含内容筛选 | string | ✖ | -| title-includes | 包含标题筛选 | string | ✖ | -| inactive-day | 非活跃天数筛选 | number | ✖ | -| lock-reason | 锁定 issue 的原因 | string | ✖ | -| exclude-labels | 排除标签筛选 | string | ✖ | - -- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 -- `issue-state`:默认为 `all`。可选值 `open` `closed`,非这 2 项时,均为 `all` -- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues -- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 -- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue +| actions | Action type | string | ✔ | +| token | [Token explain](/guide/ref#-token) | string | ✖ | +| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | +| contents | Add [reaction](/guide/ref#-reactions-type) for this comment | string | ✖ | +| labels | Labels filtering | string | ✖ | +| issue-state | State filtering | string | ✖ | +| issue-assignee | Assignee filtering | string | ✖ | +| issue-creator | Creator filtering | string | ✖ | +| issue-mentioned | Mentioned filtering | string | ✖ | +| body-includes | Body filtering | string | ✖ | +| title-includes | Title filtering | string | ✖ | +| inactive-day | Inactive days filtering | number | ✖ | +| lock-reason | Reason for locking issue | string | ✖ | +| exclude-labels | Exclude labels filtering | string | ✖ | + +- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all +- `issue-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all` +- `issue-assignee`: Multiplayer is not supported. If you do not enter or enter *, all will be searched. Entering `none` will query issues for which the specified person is not added +- `inactive-day`: When entering, it will filter the issue update time earlier than the current time minus the number of inactive days. If not entered, all +- `exclude-labels`: When set to include `$exclude-empty`, no label issue can be excluded ## `mark-assignees` -快捷加指定人,仅作用于 issue 新增编辑评论。 +Quickly assign person, only for the issue to add editor comments. ```yml name: Issue Mark Assignees @@ -284,23 +287,23 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| assign-command | 可设置简洁命令,如:`/a` | string | ✖ | -| require-permission | 要求权限,默认为 `write` | string | ✖ | - -- `assign-command`:可设置简洁命令。默认:`/assign` -- `require-permission`:可选值有 `admin`,`write`,`read`,`none` - - 团队成员若设置 `read` 权限,则为 `read` - - 外部 Collaborator 若设置 `read` 权限,则为 `read` - - 普通用户为 `read` 权限 - - 当设置 `write` 后,`admin` 和 `write` 满足条件 +| actions | Action type | string | ✔ | +| token | [Token explain](/guide/ref#-token) | string | ✖ | +| assign-command | Simple commands can be set, such as: `/a` | string | ✖ | +| require-permission | Permission required, default is `write` | string | ✖ | + +- `assign-command`: default `/assign` +- `require-permission`: Optional values are `admin`, `write`, `read`, `none` + - If the team member sets the `read` permission, it is `read` + - If the external Collaborator is set to `read` permission, it is `read` + - Ordinary users have `read` permission + - When set `write`, `admin` and `write` meet the conditions ## `mark-duplicate` -快捷标记重复问题,仅作用于 issue 新增编辑评论。 +Quickly mark duplicate questions, only for issue new comments or edit comments. ```yml name: Issue Mark Duplicate @@ -320,37 +323,39 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| duplicate-command | 可设置简洁命令,如:`/d` | string | ✖ | -| duplicate-labels | 为该 issue 额外增加 labels | string | ✖ | -| remove-labels | 设置可移除的 labels | string | ✖ | -| labels | 替换该 issue 的 labels | string | ✖ | -| emoji | 为该评论的增加 [emoji](/guide/ref#-emoji-类型) | string | ✖ | -| close-issue | 是否同时关闭该 issue | string | ✖ | -| require-permission | 要求权限,默认为 `write` | string | ✖ | -| close-reason | 关闭原因。默认`not_planned`未计划,`completed`完成 | string | ✖ | - -- `duplicate-command`:当设置简洁命令时,同时仍支持原有 `Duplicate of`。屏蔽内容包含 `?` -- `labels`:优先级最高 -- `close-issue`:`true` 或 `'true'` 均可生效 -- `require-permission`:可选值有 `admin`,`write`,`read`,`none` - - 团队成员若设置 `read` 权限,则为 `read` - - 外部 Collaborator 若设置 `read` 权限,则为 `read` - - 普通用户为 `read` 权限 - - 当设置 `write` 后,`admin` 和 `write` 满足条件 +| actions | Action type | string | ✔ | +| token | [Token explain](/guide/ref#-token) | string | ✖ | +| duplicate-command | Simple commands can be set, such as: `/d` | string | ✖ | +| duplicate-labels | Add additional labels to this issue | string | ✖ | +| remove-labels | Set removable labels | string | ✖ | +| labels | Replace the labels of the issue | string | ✖ | +| emoji | Add [emoji](/guide/ref#-emoji-type) for this comment | string | ✖ | +| close-issue | Whether to close the issue at the same time | string | ✖ | +| require-permission | Permission required, default is `write` | string | ✖ | +| close-reason | Reason for closing. Default `not_planned`, another `completed` | string | ✖ | + +- `duplicate-command`: When setting concise commands, while still supporting the original `Duplicate of`. Block content contains `?` +- `labels`: Highest priority +- `close-issue`: Both `true` or `'true'` can take effect +- `require-permission`: Optional values are `admin`, `write`, `read`, `none` + - If the team member sets the `read` permission, it is `read` + - If the external Collaborator is set to `read` permission, it is `read` + - Ordinary users have `read` permission + - When set `write`, `admin` and `write` meet the conditions -注意:使用简洁命令创建的 Duplicate 不显示下图红框内容。但其实这个没有任何影响的。 +Note: Duplicate created with the concise command does not display the content of the red box in the figure below. But in fact this has no effect. ![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*PN2tS7PjDQ4AAAAAAAAAAAAAARQnAQ) ## `welcome` -当一个 issue 新建时,对首次新建 issue 的用户进行欢迎。若用户非首次新建,则无操作。 +When an issue is created, the user who created the issue for the first time is welcome. + +If the user is not creating for the first time, there is no operation. ```yml name: Issue Welcome @@ -374,13 +379,13 @@ jobs: issue-emoji: '+1, -1, eyes' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | -| body | 评论欢迎的内容,不填则不评论 | string | ✖ | -| labels | 为该 issue 增加 labels | string | ✖ | -| assignees | 为该 issue 增加 assignees | string | ✖ | -| issue-emoji | 为该 issue 增加 [emoji](/guide/ref#-emoji-类型) | string | ✖ | - -- 若这 4 个可选项都不填,则无操作 +| actions | Action type | string | ✔ | +| token | [Token explain](/guide/ref#-token) | string | ✖ | +| body | Comment on the welcome content, no comment if you leave it blank | string | ✖ | +| labels | Add labels to this issue | string | ✖ | +| assignees | Add assignees to this issue | string | ✖ | +| issue-emoji | Add [emoji](/guide/ref#-emoji-type) to this issue| string | ✖ | + +- If these 4 options are not filled, no operation diff --git a/web/docs/advanced.zh-CN.md b/web/docs/advanced.zh-CN.md new file mode 100644 index 00000000..1cf141fb --- /dev/null +++ b/web/docs/advanced.zh-CN.md @@ -0,0 +1,386 @@ +--- +toc: menu +--- + +# 🌟 进 阶 + +进阶用法不建议 actions 多个一次同时使用。 + +## `check-inactive` + +每月 1 号 UTC 0 时,对所有 30 天以上未活跃的 issues 增加 `inactive` 标签。 + +```yml +name: Check inactive + +on: + schedule: + - cron: "0 0 1 * *" + +jobs: + check-inactive: + runs-on: ubuntu-latest + steps: + - name: check-inactive + uses: actions-cool/issues-helper@v3 + with: + actions: 'check-inactive' + token: ${{ secrets.GITHUB_TOKEN }} + inactive-day: 30 +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | +| emoji | 为该评论增加 [emoji](/zh-CN/guide/ref#-emoji-类型) | string | ✖ | +| labels | 标签筛选 | string | ✖ | +| issue-state | 状态筛选 | string | ✖ | +| issue-assignee | 指定人筛选 | string | ✖ | +| issue-creator | 创建人筛选 | string | ✖ | +| issue-mentioned | 提及人筛选 | string | ✖ | +| body-includes | 包含内容筛选 | string | ✖ | +| title-includes | 包含标题筛选 | string | ✖ | +| inactive-day | 非活跃天数筛选 | number | ✖ | +| inactive-label | 新增标签名称 | string | ✖ | +| exclude-labels | 排除标签筛选 | string | ✖ | + +- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 +- `issue-state`:默认为 `all`。可选值 `open` `closed`,非这 2 项时,均为 `all` +- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues +- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 +- `inactive-label`:默认为 `inactive`,可自定义其他。当项目未包含该 label 时,会自动新建 +- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue + +## `check-issue` + +根据传入的参数和 `issue-number` 来检查该 issue 是否满足条件,返回一个布尔值。 + +下面的例子效果是:当 issue 新开时,校验当前 issue 指定人是否包含 `x1` 或者 `x2`,满足一个指定人即可校验通过,同时校验标题是否满足条件,[校验规则](/zh-CN/guide/ref#-includes-校验规则)。 + +```yml +name: Check Issue + +on: + issues: + types: [edited] + +jobs: + check-issue: + runs-on: ubuntu-latest + steps: + - name: check-issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'check-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + assignee-includes: 'x1,x2' + title-includes: 'x1,x2/y1,y2' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| assignee-includes | 是否包含指定人 | string | ✖ | +| title-includes | 标题包含校验 | string | ✖ | +| title-excludes | 检测标题移除默认 title 后是否为空 | string | ✖ | +| body-includes | 内容包含校验 | string | ✖ | + +- `title-includes` `body-includes` 支持格式 `x1,x2` 或者 `x1,x2/y1,y2`。只支持两个层级 +- 返回 `check-result`,由于 yml 原因,判断条件为 `if: steps.xxid.outputs.check-result == 'true'` + +## `close-issues` + +每 7 天 UTC 0 时,关闭已填加 `need info` label 且 7 天以上未活跃的 issues。 + +```yml +name: Check need info + +on: + schedule: + - cron: "0 0 */7 * *" + +jobs: + check-need-info: + runs-on: ubuntu-latest + steps: + - name: close-issues + uses: actions-cool/issues-helper@v3 + with: + actions: 'close-issues' + token: ${{ secrets.GITHUB_TOKEN }} + labels: 'need info' + inactive-day: 7 +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | +| emoji | 为该评论增加 [emoji](/zh-CN/guide/ref#-emoji-类型) | string | ✖ | +| labels | 标签筛选 | string | ✖ | +| issue-assignee | 指定人筛选 | string | ✖ | +| issue-creator | 创建人筛选 | string | ✖ | +| issue-mentioned | 提及人筛选 | string | ✖ | +| body-includes | 包含内容筛选 | string | ✖ | +| title-includes | 包含标题筛选 | string | ✖ | +| inactive-day | 非活跃天数筛选 | number | ✖ | +| exclude-labels | 排除标签筛选 | string | ✖ | +| close-reason | 关闭原因。默认`not_planned`未计划,`completed`完成 | string | ✖ | + +- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 +- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues +- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 +- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue + +## `find-comments` + +查找当前仓库 1 号 issue 中,创建者是 k ,内容包含 `this` 的评论列表。 + +```yml +- name: Find comments + uses: actions-cool/issues-helper@v3 + with: + actions: 'find-comments' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: 1 + comment-auth: 'k' + body-includes: 'this' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| comment-auth | 评论创建者,不填时会查询所有 | string | ✖ | +| body-includes | 评论内容包含过滤,不填时无校验 | string | ✖ | +| direction | 返回 `comments` 排序 | string | ✖ | + +- 返回 `comments`,格式如下: + +```js +[ + {id: 1, auth: 'x', body: 'xxx', created: '', updated: ''}, + {id: 2, auth: 'x', body: 'xxx', created: '', updated: ''}, +] +``` + +- `direction` 默认为升序,只有设置 `desc` 时,会返回降序 +- 返回数组中 `created` `updated`,由所处环境决定,会是 UTC +0 + +## `find-issues` + +查找当前仓库,创建者是 k ,title 包含 `this` ,body 包含 `that`,打开状态的 issues 列表。 + +```yml +- name: Find issues + uses: actions-cool/issues-helper@v3 + with: + actions: 'find-issues' + token: ${{ secrets.GITHUB_TOKEN }} + issue-creator: 'k' + issue-state: 'open' + title-includes: 'this' + body-includes: 'that' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-state | 状态筛选 | string | ✖ | +| issue-creator | 创建者筛选 | string | ✖ | +| title-includes | 标题包含过滤,不填时无校验 | string | ✖ | +| body-includes | 内容包含过滤,不填时无校验 | string | ✖ | +| exclude-labels | 排除标签筛选 | string | ✖ | +| inactive-day | 非活跃天数筛选 | number | ✖ | +| direction | 返回 `issues` 排序 | string | ✖ | + +- 返回 `issues`,格式如下: + +```js +[ + {number: 1, auth: 'x', body: 'xxx', body: 'xxx', state: 'open', created: '', updated: ''}, + {number: 2, auth: 'x', body: 'xxx', body: 'xxx', state: 'closed', created: '', updated: ''}, +] +``` + +- `direction` 默认为升序,只有设置 `desc` 时,会返回降序 +- 返回数组中 `created` `updated`,由所处环境决定,会是 UTC +0 +- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue + +## `lock-issues` + +每 3 个月 1 号 UTC 0 时,锁定已填加 `inactive` label 且 128 天以上未活跃的所有 issues。 + +```yml +name: Lock inactive issues + +on: + schedule: + - cron: "0 0 1 */3 *" + +jobs: + lock-issues: + runs-on: ubuntu-latest + steps: + - name: lock-issues + uses: actions-cool/issues-helper@v3 + with: + actions: 'lock-issues' + token: ${{ secrets.GITHUB_TOKEN }} + labels: 'inactive' + inactive-day: 128 +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | +| emoji | 为该评论增加 [emoji](/zh-CN/guide/ref#-emoji-类型) | string | ✖ | +| labels | 标签筛选 | string | ✖ | +| issue-state | 状态筛选 | string | ✖ | +| issue-assignee | 指定人筛选 | string | ✖ | +| issue-creator | 创建人筛选 | string | ✖ | +| issue-mentioned | 提及人筛选 | string | ✖ | +| body-includes | 包含内容筛选 | string | ✖ | +| title-includes | 包含标题筛选 | string | ✖ | +| inactive-day | 非活跃天数筛选 | number | ✖ | +| lock-reason | 锁定 issue 的原因 | string | ✖ | +| exclude-labels | 排除标签筛选 | string | ✖ | + +- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 +- `issue-state`:默认为 `all`。可选值 `open` `closed`,非这 2 项时,均为 `all` +- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues +- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 +- `exclude-labels`:设置包含 `$exclude-empty` 时,可排除无 label issue + +## `mark-assignees` + +快捷加指定人,仅作用于 issue 新增编辑评论。 + +```yml +name: Issue Mark Assignees + +on: + issue_comment: + types: [created, edited] + +jobs: + mark-assignees: + runs-on: ubuntu-latest + steps: + - name: mark-assignees + uses: actions-cool/issues-helper@v3 + with: + actions: 'mark-assignees' + token: ${{ secrets.GITHUB_TOKEN }} +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| assign-command | 可设置简洁命令,如:`/a` | string | ✖ | +| require-permission | 要求权限,默认为 `write` | string | ✖ | + +- `assign-command`:可设置简洁命令。默认:`/assign` +- `require-permission`:可选值有 `admin`,`write`,`read`,`none` + - 团队成员若设置 `read` 权限,则为 `read` + - 外部 Collaborator 若设置 `read` 权限,则为 `read` + - 普通用户为 `read` 权限 + - 当设置 `write` 后,`admin` 和 `write` 满足条件 + +## `mark-duplicate` + +快捷标记重复问题,仅作用于 issue 新增编辑评论。 + +```yml +name: Issue Mark Duplicate + +on: + issue_comment: + types: [created, edited] + +jobs: + mark-duplicate: + runs-on: ubuntu-latest + steps: + - name: mark-duplicate + uses: actions-cool/issues-helper@v3 + with: + actions: 'mark-duplicate' + token: ${{ secrets.GITHUB_TOKEN }} +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| duplicate-command | 可设置简洁命令,如:`/d` | string | ✖ | +| duplicate-labels | 为该 issue 额外增加 labels | string | ✖ | +| remove-labels | 设置可移除的 labels | string | ✖ | +| labels | 替换该 issue 的 labels | string | ✖ | +| emoji | 为该评论的增加 [emoji](/zh-CN/guide/ref#-emoji-类型) | string | ✖ | +| close-issue | 是否同时关闭该 issue | string | ✖ | +| require-permission | 要求权限,默认为 `write` | string | ✖ | +| close-reason | 关闭原因。默认`not_planned`未计划,`completed`完成 | string | ✖ | + +- `duplicate-command`:当设置简洁命令时,同时仍支持原有 `Duplicate of`。屏蔽内容包含 `?` +- `labels`:优先级最高 +- `close-issue`:`true` 或 `'true'` 均可生效 +- `require-permission`:可选值有 `admin`,`write`,`read`,`none` + - 团队成员若设置 `read` 权限,则为 `read` + - 外部 Collaborator 若设置 `read` 权限,则为 `read` + - 普通用户为 `read` 权限 + - 当设置 `write` 后,`admin` 和 `write` 满足条件 + + +注意:使用简洁命令创建的 Duplicate 不显示下图红框内容。但其实这个没有任何影响的。 + + +![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*PN2tS7PjDQ4AAAAAAAAAAAAAARQnAQ) + +## `welcome` + +当一个 issue 新建时,对首次新建 issue 的用户进行欢迎。若用户非首次新建,则无操作。 + +```yml +name: Issue Welcome + +on: + issues: + types: [opened] + +jobs: + issue-welcome: + runs-on: ubuntu-latest + steps: + - name: welcome + uses: actions-cool/issues-helper@v3 + with: + actions: 'welcome' + token: ${{ secrets.GITHUB_TOKEN }} + body: hi @${{ github.event.issue.user.login }}, welcome! + labels: 'welcome1, welcome2' + assignees: 'xx1' + issue-emoji: '+1, -1, eyes' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✔ | +| body | 评论欢迎的内容,不填则不评论 | string | ✖ | +| labels | 为该 issue 增加 labels | string | ✖ | +| assignees | 为该 issue 增加 assignees | string | ✖ | +| issue-emoji | 为该 issue 增加 [emoji](/zh-CN/guide/ref#-emoji-类型) | string | ✖ | + +- 若这 4 个可选项都不填,则无操作 diff --git a/web/docs/base.en-US.md b/web/docs/base.en-US.md deleted file mode 100644 index 472fefa6..00000000 --- a/web/docs/base.en-US.md +++ /dev/null @@ -1,441 +0,0 @@ ---- -toc: menu ---- - -# ⭐ Base - -In order to better display the function, the following is an example of the actual scene, please refer to it flexibly. - -## `add-assignees` - -When an issue is added or modified, assign this issue to one or more people. - -```yml -name: Add Assigness - -on: - issues: - types: [opened, edited] - -jobs: - add-assigness: - runs-on: ubuntu-latest - steps: - - name: Add assigness - uses: actions-cool/issues-helper@v3 - with: - actions: 'add-assignees' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - assignees: 'xxx' or 'xx1,xx2' - random-to: 1 -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ | -| assignees | Designated person. No operation when no input or empty character | string | ✖ | -| random-to | When set, it will be randomly selected in assignees | number | ✖ | - -- `actions` support multiple and separated by comma. Like: `add-assignees,add-labels` -- The `name` can be modified according to the actual situation -- [Reference to on](/en-US/guide/ref#-github-docs) -- `${{ github.event.issue.number }}` is the current issue. [More references](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events) -- `assignees` support multiple and separated by comma -- You can assign up to 10 people to each issue - -## `add-labels` - -When the content of a new issue does not contain the specified format, add labels for the issue. - -```yml -name: Add Labels - -on: - issues: - types: [opened] - -jobs: - add-labels: - runs-on: ubuntu-latest - if: contains(github.event.issue.body, 'xxx') == false - steps: - - name: Add labels - uses: actions-cool/issues-helper@v3 - with: - actions: 'add-labels' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - labels: 'bug' or 'xx1,xx2' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ | -| labels | New labels. When it is not filled in or is empty character, do not add | string | ✖ | - -- `labels` support multiple and separated by comma - -## `close-issue` - -Close the specified issue. - -```yml -- name: Close issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'close-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: xxx -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ | -| close-reason | Reason for closing. Default `not_planned`, another `completed` | string | ✖ | - -## `create-comment` - -When a designated label is added, comment on the issue. - -```yml -name: Create Comment - -on: - issues: - types: [labeled] - -jobs: - create-comment: - runs-on: ubuntu-latest - if: github.event.label.name == 'xxx' - steps: - - name: Create comment - uses: actions-cool/issues-helper@v3 - with: - actions: 'create-comment' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - body: | - Hello @${{ github.event.issue.user.login }}. Add some comments. - - 你好 @${{ github.event.issue.user.login }}。巴拉巴拉。 - emoji: '+1' or '+1,heart' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ | -| body | Add comment content | string | ✖ | -| emoji | Add [emoji](/en-US/guide/ref#-emoji-type) | string | ✖ | - -- No action when `body` is empty -- Return `comment-id`, which can be used for subsequent operations. [Usage reference](/en-US/guide/ref#-outputs-use) -- `${{ github.event.issue.user.login }}` indicates the creator of the issue -- `emoji` support multiple and separated by comma - -## `create-issue` - -Here is an example, add an issue at UTC 00:00 on the 1st of every month. - -```yml -name: Create Issue - -on: - schedule: - - cron: "0 0 1 * *" - -jobs: - create-issue: - runs-on: ubuntu-latest - steps: - - name: Create issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'create-issue' - token: ${{ secrets.GITHUB_TOKEN }} - title: 'xxxx' - body: 'xxxx' - labels: 'xx' - assignees: 'xxx' - emoji: '+1' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| title | The title of the new issue | string | ✖ | -| body | The body of the new issue | string | ✖ | -| labels | The labels for the new issue | string | ✖ | -| assignees | The assignees for the new issue | string | ✖ | -| random-to | When set, it will be randomly selected in assignees | number | ✖ | -| emoji | Add [emoji](/en-US/guide/ref#-emoji-type) | string | ✖ | - -- `title` default is `Default Title` -- Return `issue-number`. [Usage reference](/en-US/guide/ref#-outputs-use) - -## `create-label` - -Create label. If you want to maintain labels in batches, [see](https://github.com/actions-cool/labels-helper). - -```yml -- name: Create label - uses: actions-cool/issues-helper@v3 - with: - actions: 'create-label' - token: ${{ secrets.GITHUB_TOKEN }} - label-name: 'xx' - label-color: '0095b3' - label-desc: 'xx' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| label-name | Label name, emoji support | string | ✔ | -| label-color | Label color, the format is hexadecimal color code, without `#` | string | ✖ | -| label-desc | Label description | string | ✖ | - -- `label-name`: If it already exists, no operation -- `label-color`: Default is `ededed` - -## `delete-comment` - -According to [`comment-id`](/en-US/guide/ref#-comment-id) delete the specified comment. - -```yml -- name: Delete comment - uses: actions-cool/issues-helper@v3 - with: - actions: 'delete-comment' - token: ${{ secrets.GITHUB_TOKEN }} - comment-id: xxx -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| comment-id | The comment ID | number | ✔ | - -## `lock-issue` - -When the `invalid` label is added, the issue is locked. - -```yml -name: Lock Issue - -on: - issues: - types: [labeled] - -jobs: - lock-issue: - runs-on: ubuntu-latest - if: github.event.label.name == 'invalid' - steps: - - name: Lock issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'lock-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ | -| lock-reason | Reason for locking issue | string | ✖ | - -- `lock-reason`: Optional values are `off-topic` `too heated` `resolved` `spam` - -## `open-issue` - -Open the specified issue. - -```yml -- name: Open issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'open-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: xxx -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ | - -## `remove-assignees` - -Remove the person designated by issue. - -```yml -- name: Remove assignees - uses: actions-cool/issues-helper@v3 - with: - actions: 'remove-assignees' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - assignees: 'xx' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ | -| assignees | Designated person removed. When it is an empty character, do not remove | string | ✔ | - -## `remove-labels` - -Remove the specified labels. - -```yml -- name: Remove labels - uses: actions-cool/issues-helper@v3 - with: - actions: 'remove-labels' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - labels: 'xx' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ | -| labels | The removed labels. When it is a blank character, do not remove | string | ✔ | - -- `labels` supports multiple, such as `x1,x2,x3`, only the labels added by the issue will be removed - -## `set-labels` - -Replace the labels of issue. - -```yml -- name: Set labels - uses: actions-cool/issues-helper@v3 - with: - actions: 'set-labels' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - labels: 'xx' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ | -| labels | labels set. When empty characters, will remove all | string | ✔ | - -## `unlock-issue` - -Unlock the specified issue. - -```yml -- name: Unlock issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'unlock-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ | - -## `update-comment` - -Update the specified comment according to [`comment-id`](/en-US/guide/ref#-comment-id). - -The following example shows that 👀 is added for each new comment. - -```yml -name: Add eyes to each comment - -on: - issue_comment: - types: [created] - -jobs: - update-comment: - runs-on: ubuntu-latest - steps: - - name: Update comment - uses: actions-cool/issues-helper@v3 - with: - actions: 'update-comment' - token: ${{ secrets.GITHUB_TOKEN }} - comment-id: ${{ github.event.comment.id }} - emoji: 'eyes' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| comment-id | The comment ID | number | ✔ | -| out-comments | The output of `find-comments`, if you find multiple, operate multiple | string | ✖ | -| body | Update the content of comment | string | ✖ | -| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | -| emoji | Add [emoji](/en-US/guide/ref#-emoji-type) | string | ✖ | - -- When `body` is not entered, it will remain as it is -- When `update-mode` is `append`, additional operations will be performed. Anything other than `append` will be replaced. Only effective for `body` -- When `out-comments` is entered, `comment-id` does not work - -## `update-issue` - -Update the specified issue according to the `issue-number`. - -```yml -- name: Update issue - uses: actions-cool/issues-helper@v3 - with: - actions: 'update-issue' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - state: 'open' - title: 'xxx' - body: 'xxxx' - update-mode: 'replace' - labels: 'xx' - assignees: 'xxx' - emoji: '+1' -``` - -| Param | Desc | Type | Required | -| -- | -- | -- | -- | -| actions | Action type | string | ✔ | -| token | [Token explain](/en-US/guide/ref#-token) | string | ✖ | -| issue-number | The number of issue. When not input, it will be obtained from the trigger event | number | ✖ | -| state | Modify the status of issue, optional value `open` `closed` | string | ✖ | -| title | Modify the title of the issue | string | ✖ | -| body | Modify the content of issue | string | ✖ | -| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | -| labels | Replace the labels of issue | string | ✖ | -| assignees | Replace the assignees of issue | string | ✖ | -| emoji | Add [emoji](/en-US/guide/ref#-emoji-type) | string | ✖ | - -- `state` defaults to `open` -- When the option is not filled, it will keep the original diff --git a/web/docs/base.md b/web/docs/base.md index 053d8739..78e0c0bb 100644 --- a/web/docs/base.md +++ b/web/docs/base.md @@ -2,13 +2,13 @@ toc: menu --- -为了更好的展示功能,下面以实际场景举例,请灵活参考。 +# ⭐ Base -# ⭐ 基 础 +In order to better display the function, the following is an example of the actual scene, please refer to it flexibly. ## `add-assignees` -当一个 issue 新增或修改时,将这个 issue 指定某人或多人。 +When an issue is added or modified, assign this issue to one or more people. ```yml name: Add Assigness @@ -31,24 +31,24 @@ jobs: random-to: 1 ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| assignees | 指定人。当不填或者为空字符时,不操作 | string | ✖ | -| random-to | 当设置时,会在 assignees 中随机选择 | number | ✖ | - -- `actions` 支持多个,需用逗号隔开。如:`add-assignees,add-labels` -- 其中的 `name` 可根据自行根据实际情况修改 -- [on 参考](/guide/ref#-github-相关文档) -- `${{ github.event.issue.number }}` 表示当前 issue,[更多参考](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events) -- `assignees` 支持多个,需用逗号隔开 -- assign 最多只能设定 10 个 +| 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 | ✖ | +| assignees | Designated person. No operation when no input or empty character | string | ✖ | +| random-to | When set, it will be randomly selected in assignees | number | ✖ | + +- `actions` support multiple and separated by comma. Like: `add-assignees,add-labels` +- The `name` can be modified according to the actual situation +- [Reference to on](/guide/ref#-github-docs) +- `${{ github.event.issue.number }}` is the current issue. [More references](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events) +- `assignees` support multiple and separated by comma +- You can assign up to 10 people to each issue ## `add-labels` -当一个新增的 issue 内容不包含指定格式时,为这个 issue 添加 labels。 +When the content of a new issue does not contain the specified format, add labels for the issue. ```yml name: Add Labels @@ -68,21 +68,21 @@ jobs: actions: 'add-labels' token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} - labels: 'bug' or 'bug1,bug2' + labels: 'bug' or 'xx1,xx2' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| labels | 新增的 labels。当不填或者为空字符时,不新增 | string | ✖ | +| 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 | New labels. When it is not filled in or is empty character, do not add | string | ✖ | -- `labels` 支持多个,需用逗号隔开 +- `labels` support multiple and separated by comma ## `close-issue` -关闭指定 issue。 +Close the specified issue. ```yml - name: Close issue @@ -93,16 +93,16 @@ jobs: issue-number: xxx ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| close-reason | 关闭原因。默认`not_planned`未计划,`completed`完成 | string | ✖ | +| 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 | ✖ | +| close-reason | Reason for closing. Default `not_planned`, another `completed` | string | ✖ | ## `create-comment` -当新增一个指定 label 时,对该 issue 进行评论。 +When a designated label is added, comment on the issue. ```yml name: Create Comment @@ -123,28 +123,28 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | - Hello ${{ github.event.issue.user.login }}. Add some comments. + Hello @${{ github.event.issue.user.login }}. Add some comments. - 你好 ${{ github.event.issue.user.login }}。巴拉巴拉。 + 你好 @${{ github.event.issue.user.login }}。巴拉巴拉。 emoji: '+1' or '+1,heart' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| body | 新增评论的内容 | string | ✖ | -| emoji | 为新增评论的增加 [emoji](/guide/ref#-emoji-类型) | string | ✖ | +| 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 | ✖ | +| body | Add comment content | string | ✖ | +| emoji | Add [emoji](/guide/ref#-emoji-type) | string | ✖ | -- `body` 为空时,无操作 -- 返回 `comment-id`,可用于之后操作。[用法参考](/guide/ref#-outputs-使用) -- `${{ github.event.issue.user.login }}` 表示该 issue 的创建者 -- `emoji` 支持多个,需用逗号隔开 +- No action when `body` is empty +- Return `comment-id`, which can be used for subsequent operations. [Usage reference](/guide/ref#-outputs-use) +- `${{ github.event.issue.user.login }}` indicates the creator of the issue +- `emoji` support multiple and separated by comma ## `create-issue` -感觉新增 issue 使用场景不多。这里举例,每月 1 号 UTC 00:00 新增一个 issue。 +Here is an example, add an issue at UTC 00:00 on the 1st of every month. ```yml name: Create Issue @@ -169,23 +169,23 @@ jobs: emoji: '+1' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| title | 新增 issue 的标题 | string | ✖ | -| body | 新增 issue 的内容 | string | ✖ | -| labels | 为新增 issue 添加 labels | string | ✖ | -| assignees | 为新增 issue 添加 assignees | string | ✖ | -| random-to | 当设置时,会在 assignees 中随机选择 | number | ✖ | -| emoji | 为新增 issue 增加 [emoji](/guide/ref#-emoji-类型) | string | ✖ | - -- `title` 默认为:`Default Title` -- 返回 `issue-number`,[用法参考](/guide/ref#-outputs-使用) +| actions | Action type | string | ✔ | +| token | [Token explain](/guide/ref#-token) | string | ✖ | +| title | The title of the new issue | string | ✖ | +| body | The body of the new issue | string | ✖ | +| labels | The labels for the new issue | string | ✖ | +| assignees | The assignees for the new issue | string | ✖ | +| random-to | When set, it will be randomly selected in assignees | number | ✖ | +| emoji | Add [emoji](/guide/ref#-emoji-type) | string | ✖ | + +- `title` default is `Default Title` +- Return `issue-number`. [Usage reference](/guide/ref#-outputs-use) ## `create-label` -新增 label。若想批量维护 labels,[可查看](https://github.com/actions-cool/labels-helper)。 +Create label. If you want to maintain labels in batches, [see](https://github.com/actions-cool/labels-helper). ```yml - name: Create label @@ -198,20 +198,20 @@ jobs: label-desc: 'xx' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| label-name | 标签名称,支持 emoji | string | ✔ | -| label-color | 标签颜色,格式为 16 进制色码,不加 `#` | string | ✖ | -| label-desc | 标签描述 | string | ✖ | +| actions | Action type | string | ✔ | +| token | [Token explain](/guide/ref#-token) | string | ✖ | +| label-name | Label name, emoji support | string | ✔ | +| label-color | Label color, the format is hexadecimal color code, without `#` | string | ✖ | +| label-desc | Label description | string | ✖ | -- `label-name`:若已存在,则无操作 -- `label-color`:默认为 `ededed` +- `label-name`: If it already exists, no operation +- `label-color`: Default is `ededed` ## `delete-comment` -根据 [`comment-id`](/guide/ref#-comment-id) 删除指定评论。 +According to [`comment-id`](/guide/ref#-comment-id) delete the specified comment. ```yml - name: Delete comment @@ -222,15 +222,34 @@ jobs: comment-id: xxx ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| comment-id | 指定的 comment | number | ✔ | +| actions | Action type | string | ✔ | +| token | [Token explain](/guide/ref#-token) | string | ✖ | +| comment-id | The comment ID | number | ✔ | + +## `get-issue` + +Query issue information. + +```yml +- name: Get Issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'get-issue' + token: ${{ secrets.GITHUB_TOKEN }} +``` + +| Param | Desc | Type | Required | +| -- | -- | -- | -- | +| actions | Action type | string | ✔ | +| token | [Token explain](/guide/ref#-token) | string | ✖ | + +- Return `issue-number` `issue-title` `issue-body` `issue-labels` `issue-assignees` `issue-state`. [Usage reference](/guide/ref#-outputs-use) ## `lock-issue` -当新增 `invalid` label 时,对该 issue 进行锁定。 +When the `invalid` label is added, the issue is locked. ```yml name: Lock Issue @@ -252,18 +271,18 @@ jobs: issue-number: ${{ github.event.issue.number }} ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| lock-reason | 锁定 issue 的原因 | string | ✖ | +| 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 | ✖ | +| lock-reason | Reason for locking issue | string | ✖ | -- `lock-reason`:可选值有 `off-topic` `too heated` `resolved` `spam` +- `lock-reason`: Optional values are `off-topic` `too heated` `resolved` `spam` ## `open-issue` -打开指定 issue。 +Open the specified issue. ```yml - name: Open issue @@ -274,15 +293,15 @@ jobs: issue-number: xxx ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| 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 | ✖ | ## `remove-assignees` -移除 issue 指定人员。 +Remove the person designated by issue. ```yml - name: Remove assignees @@ -294,16 +313,16 @@ jobs: assignees: 'xx' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| assignees | 移除的指定人。当为空字符时,不进行移除 | string | ✔ | +| 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 | ✖ | +| assignees | Designated person removed. When it is an empty character, do not remove | string | ✔ | ## `remove-labels` -移除指定 labels。 +Remove the specified labels. ```yml - name: Remove labels @@ -315,18 +334,18 @@ jobs: labels: 'xx' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| labels | 移除的 labels。当为空字符时,不进行移除 | string | ✔ | +| 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 removed labels. When it is a blank character, do not remove | string | ✔ | -- `labels` 支持多个,如 `x1,x2,x3`,只会移除 issue 已添加的 labels +- `labels` supports multiple, such as `x1,x2,x3`, only the labels added by the issue will be removed ## `set-labels` -替换 issue 的 labels。 +Replace the labels of issue. ```yml - name: Set labels @@ -338,16 +357,16 @@ jobs: labels: 'xx' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| labels | labels 设置。当空字符时,会移除所有 | string | ✔ | +| 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 | labels set. When empty characters, will remove all | string | ✔ | ## `unlock-issue` -解锁指定 issue。 +Unlock the specified issue. ```yml - name: Unlock issue @@ -358,17 +377,17 @@ jobs: issue-number: ${{ github.event.issue.number }} ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| 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 | ✖ | ## `update-comment` -根据 [`comment-id`](/guide/ref#-comment-id) 更新指定评论。 +Update the specified comment according to [`comment-id`](/guide/ref#-comment-id). -下面的例子展示的是,为每个新增的 comment 增加 👀 。 +The following example shows that 👀 is added for each new comment. ```yml name: Add eyes to each comment @@ -390,23 +409,23 @@ jobs: emoji: 'eyes' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| comment-id | 指定的 comment | number | ✔ | -| out-comments | `find-comments` 的输出,若查找多个,则操作多个 | string | ✖ | -| body | 更新 comment 的内容 | string | ✖ | -| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ | -| emoji | 增加 [emoji](/guide/ref#-emoji-类型) | string | ✖ | - -- `body` 不填时,会保持原有 -- `update-mode` 为 `append` 时,会进行附加操作。非 `append` 都会进行替换。仅对 `body` 生效 -- 当 `out-comments` 输入时,`comment-id` 不起作用 +| actions | Action type | string | ✔ | +| token | [Token explain](/guide/ref#-token) | string | ✖ | +| comment-id | The comment ID | number | ✔ | +| out-comments | The output of `find-comments`, if you find multiple, operate multiple | string | ✖ | +| body | Update the content of comment | string | ✖ | +| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | +| emoji | Add [emoji](/guide/ref#-emoji-type) | string | ✖ | + +- When `body` is not entered, it will remain as it is +- When `update-mode` is `append`, additional operations will be performed. Anything other than `append` will be replaced. Only effective for `body` +- When `out-comments` is entered, `comment-id` does not work ## `update-issue` -根据 `issue-number` 更新指定 issue。 +Update the specified issue according to the `issue-number`. ```yml - name: Update issue @@ -424,18 +443,18 @@ jobs: emoji: '+1' ``` -| 参数 | 描述 | 类型 | 必填 | +| Param | Desc | Type | Required | | -- | -- | -- | -- | -| actions | 操作类型 | string | ✔ | -| token | [token 说明](/guide/ref#-token-说明) | string | ✖ | -| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | -| state | 修改 issue 的状态,可选值 `open` `closed` | string | ✖ | -| title | 修改 issue 的标题 | string | ✖ | -| body | 修改 issue 的内容 | string | ✖ | -| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ | -| labels | 替换 issue 的 labels | string | ✖ | -| assignees | 替换 issue 的 assignees | string | ✖ | -| emoji | 增加 [emoji](/guide/ref#-emoji-类型) | string | ✖ | - -- `state` 默认为 `open` -- 当可选项不填时,会保持原有 +| 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 | ✖ | +| state | Modify the status of issue, optional value `open` `closed` | string | ✖ | +| title | Modify the title of the issue | string | ✖ | +| body | Modify the content of issue | string | ✖ | +| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | +| labels | Replace the labels of issue | string | ✖ | +| assignees | Replace the assignees of issue | string | ✖ | +| emoji | Add [emoji](/guide/ref#-emoji-type) | string | ✖ | + +- `state` defaults to `open` +- When the option is not filled, it will keep the original diff --git a/web/docs/base.zh-CN.md b/web/docs/base.zh-CN.md new file mode 100644 index 00000000..d4bce035 --- /dev/null +++ b/web/docs/base.zh-CN.md @@ -0,0 +1,460 @@ +--- +toc: menu +--- + +为了更好的展示功能,下面以实际场景举例,请灵活参考。 + +# ⭐ 基 础 + +## `add-assignees` + +当一个 issue 新增或修改时,将这个 issue 指定某人或多人。 + +```yml +name: Add Assigness + +on: + issues: + types: [opened, edited] + +jobs: + add-assigness: + runs-on: ubuntu-latest + steps: + - name: Add assigness + uses: actions-cool/issues-helper@v3 + with: + actions: 'add-assignees' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + assignees: 'xxx' or 'xx1,xx2' + random-to: 1 +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| assignees | 指定人。当不填或者为空字符时,不操作 | string | ✖ | +| random-to | 当设置时,会在 assignees 中随机选择 | number | ✖ | + +- `actions` 支持多个,需用逗号隔开。如:`add-assignees,add-labels` +- 其中的 `name` 可根据自行根据实际情况修改 +- [on 参考](/zh-CN/guide/ref#-github-相关文档) +- `${{ github.event.issue.number }}` 表示当前 issue,[更多参考](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events) +- `assignees` 支持多个,需用逗号隔开 +- assign 最多只能设定 10 个 + +## `add-labels` + +当一个新增的 issue 内容不包含指定格式时,为这个 issue 添加 labels。 + +```yml +name: Add Labels + +on: + issues: + types: [opened] + +jobs: + add-labels: + runs-on: ubuntu-latest + if: contains(github.event.issue.body, 'xxx') == false + steps: + - name: Add labels + uses: actions-cool/issues-helper@v3 + with: + actions: 'add-labels' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + labels: 'bug' or 'bug1,bug2' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| labels | 新增的 labels。当不填或者为空字符时,不新增 | string | ✖ | + +- `labels` 支持多个,需用逗号隔开 + +## `close-issue` + +关闭指定 issue。 + +```yml +- name: Close issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'close-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: xxx +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| close-reason | 关闭原因。默认`not_planned`未计划,`completed`完成 | string | ✖ | + +## `create-comment` + +当新增一个指定 label 时,对该 issue 进行评论。 + +```yml +name: Create Comment + +on: + issues: + types: [labeled] + +jobs: + create-comment: + runs-on: ubuntu-latest + if: github.event.label.name == 'xxx' + steps: + - name: Create comment + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hello ${{ github.event.issue.user.login }}. Add some comments. + + 你好 ${{ github.event.issue.user.login }}。巴拉巴拉。 + emoji: '+1' or '+1,heart' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| body | 新增评论的内容 | string | ✖ | +| emoji | 为新增评论的增加 [emoji](/zh-CN/guide/ref#-emoji-类型) | string | ✖ | + +- `body` 为空时,无操作 +- 返回 `comment-id`,可用于之后操作。[用法参考](/zh-CN/guide/ref#-outputs-使用) +- `${{ github.event.issue.user.login }}` 表示该 issue 的创建者 +- `emoji` 支持多个,需用逗号隔开 + +## `create-issue` + +感觉新增 issue 使用场景不多。这里举例,每月 1 号 UTC 00:00 新增一个 issue。 + +```yml +name: Create Issue + +on: + schedule: + - cron: "0 0 1 * *" + +jobs: + create-issue: + runs-on: ubuntu-latest + steps: + - name: Create issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-issue' + token: ${{ secrets.GITHUB_TOKEN }} + title: 'xxxx' + body: 'xxxx' + labels: 'xx' + assignees: 'xxx' + emoji: '+1' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| title | 新增 issue 的标题 | string | ✖ | +| body | 新增 issue 的内容 | string | ✖ | +| labels | 为新增 issue 添加 labels | string | ✖ | +| assignees | 为新增 issue 添加 assignees | string | ✖ | +| random-to | 当设置时,会在 assignees 中随机选择 | number | ✖ | +| emoji | 为新增 issue 增加 [emoji](/zh-CN/guide/ref#-emoji-类型) | string | ✖ | + +- `title` 默认为:`Default Title` +- 返回 `issue-number`,[用法参考](/zh-CN/guide/ref#-outputs-使用) + +## `create-label` + +新增 label。若想批量维护 labels,[可查看](https://github.com/actions-cool/labels-helper)。 + +```yml +- name: Create label + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-label' + token: ${{ secrets.GITHUB_TOKEN }} + label-name: 'xx' + label-color: '0095b3' + label-desc: 'xx' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| label-name | 标签名称,支持 emoji | string | ✔ | +| label-color | 标签颜色,格式为 16 进制色码,不加 `#` | string | ✖ | +| label-desc | 标签描述 | string | ✖ | + +- `label-name`:若已存在,则无操作 +- `label-color`:默认为 `ededed` + +## `delete-comment` + +根据 [`comment-id`](/zh-CN/guide/ref#-comment-id) 删除指定评论。 + +```yml +- name: Delete comment + uses: actions-cool/issues-helper@v3 + with: + actions: 'delete-comment' + token: ${{ secrets.GITHUB_TOKEN }} + comment-id: xxx +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| comment-id | 指定的 comment | number | ✔ | + +## `get-issue` + +查询 issue 信息。 + +```yml +- name: Get Issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'get-issue' + token: ${{ secrets.GITHUB_TOKEN }} +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | + +- 返回 `issue-number` `issue-title` `issue-body` `issue-labels` `issue-assignees` `issue-state`,[用法参考](/zh-CN/guide/ref#-outputs-使用) + +## `lock-issue` + +当新增 `invalid` label 时,对该 issue 进行锁定。 + +```yml +name: Lock Issue + +on: + issues: + types: [labeled] + +jobs: + lock-issue: + runs-on: ubuntu-latest + if: github.event.label.name == 'invalid' + steps: + - name: Lock issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'lock-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| lock-reason | 锁定 issue 的原因 | string | ✖ | + +- `lock-reason`:可选值有 `off-topic` `too heated` `resolved` `spam` + +## `open-issue` + +打开指定 issue。 + +```yml +- name: Open issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'open-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: xxx +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | + +## `remove-assignees` + +移除 issue 指定人员。 + +```yml +- name: Remove assignees + uses: actions-cool/issues-helper@v3 + with: + actions: 'remove-assignees' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + assignees: 'xx' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| assignees | 移除的指定人。当为空字符时,不进行移除 | string | ✔ | + +## `remove-labels` + +移除指定 labels。 + +```yml +- name: Remove labels + uses: actions-cool/issues-helper@v3 + with: + actions: 'remove-labels' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + labels: 'xx' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| labels | 移除的 labels。当为空字符时,不进行移除 | string | ✔ | + +- `labels` 支持多个,如 `x1,x2,x3`,只会移除 issue 已添加的 labels + +## `set-labels` + +替换 issue 的 labels。 + +```yml +- name: Set labels + uses: actions-cool/issues-helper@v3 + with: + actions: 'set-labels' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + labels: 'xx' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| labels | labels 设置。当空字符时,会移除所有 | string | ✔ | + +## `unlock-issue` + +解锁指定 issue。 + +```yml +- name: Unlock issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'unlock-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | + +## `update-comment` + +根据 [`comment-id`](/zh-CN/guide/ref#-comment-id) 更新指定评论。 + +下面的例子展示的是,为每个新增的 comment 增加 👀 。 + +```yml +name: Add eyes to each comment + +on: + issue_comment: + types: [created] + +jobs: + update-comment: + runs-on: ubuntu-latest + steps: + - name: Update comment + uses: actions-cool/issues-helper@v3 + with: + actions: 'update-comment' + token: ${{ secrets.GITHUB_TOKEN }} + comment-id: ${{ github.event.comment.id }} + emoji: 'eyes' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| comment-id | 指定的 comment | number | ✔ | +| out-comments | `find-comments` 的输出,若查找多个,则操作多个 | string | ✖ | +| body | 更新 comment 的内容 | string | ✖ | +| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ | +| emoji | 增加 [emoji](/zh-CN/guide/ref#-emoji-类型) | string | ✖ | + +- `body` 不填时,会保持原有 +- `update-mode` 为 `append` 时,会进行附加操作。非 `append` 都会进行替换。仅对 `body` 生效 +- 当 `out-comments` 输入时,`comment-id` 不起作用 + +## `update-issue` + +根据 `issue-number` 更新指定 issue。 + +```yml +- name: Update issue + uses: actions-cool/issues-helper@v3 + with: + actions: 'update-issue' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + state: 'open' + title: 'xxx' + body: 'xxxx' + update-mode: 'replace' + labels: 'xx' + assignees: 'xxx' + emoji: '+1' +``` + +| 参数 | 描述 | 类型 | 必填 | +| -- | -- | -- | -- | +| actions | 操作类型 | string | ✔ | +| token | [token 说明](/zh-CN/guide/ref#-token-说明) | string | ✖ | +| issue-number | 指定的 issue,当不传时会从触发事件中获取 | number | ✖ | +| state | 修改 issue 的状态,可选值 `open` `closed` | string | ✖ | +| title | 修改 issue 的标题 | string | ✖ | +| body | 修改 issue 的内容 | string | ✖ | +| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ | +| labels | 替换 issue 的 labels | string | ✖ | +| assignees | 替换 issue 的 assignees | string | ✖ | +| emoji | 增加 [emoji](/zh-CN/guide/ref#-emoji-类型) | string | ✖ | + +- `state` 默认为 `open` +- 当可选项不填时,会保持原有 diff --git a/web/docs/changelog.en-US.md b/web/docs/changelog.en-US.md deleted file mode 100644 index 4f4fdcbd..00000000 --- a/web/docs/changelog.en-US.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -toc: menu ---- - -# ✨ Changelog - -- v2 [upgrade reference](/en-US/guide/faq) -- v3 [changelog](/en-US/guide/faq#v3-changelog) - - diff --git a/web/docs/changelog.md b/web/docs/changelog.md index d434212a..061a666d 100644 --- a/web/docs/changelog.md +++ b/web/docs/changelog.md @@ -2,9 +2,9 @@ toc: menu --- -# ✨ 更新日志 +# ✨ Changelog -- v2 [升级参考](/guide/faq) -- v3 [变更](/guide/faq/#v3-变更) +- v2 [upgrade reference](/guide/faq) +- v3 [changelog](/guide/faq#v3-changelog) diff --git a/web/docs/changelog.zh-CN.md b/web/docs/changelog.zh-CN.md new file mode 100644 index 00000000..39e48faa --- /dev/null +++ b/web/docs/changelog.zh-CN.md @@ -0,0 +1,10 @@ +--- +toc: menu +--- + +# ✨ 更新日志 + +- v2 [升级参考](/zh-CN/guide/faq) +- v3 [变更](/zh-CN/guide/faq/#v3-变更) + + diff --git a/web/docs/guide/faq.en-US.md b/web/docs/guide/faq.en-US.md deleted file mode 100644 index cda3dc73..00000000 --- a/web/docs/guide/faq.en-US.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -toc: menu ---- - -## Is there a charge for this feature? - -GitHub Actions is provided free of charge by GitHub. Among them, the `Private` project has a monthly limit of 2000 times, [see details](https://github.com/settings/billing). The `Public` project is unlimited. - -### Is there a rate limit? - -Yes. The bottom layer of Action uses GitHub REST API. The general situation is 5000 times per hour. It is basically sufficient in principle, and it is also required to avoid invalid requests when defining Action. [Detailed view](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting). - -## Are there any ready-made templates for reference? - -Yes. - -1. You can use this [GitHub Actions workflow template](https://github.com/actions-cool/.github) repository template -2. Personal exercises and tests [Actions](https://github.com/actions-cool/test-issues-helper) repository -3. You can also refer to the warehouse of [online users](/en-US#-who-is-using) - -## I want to pause Actions, is there an easy way? - -Yes, you can directly modify `actions`. For example: `actions:'create-comment'` is changed to `actions:'#create-comment'`. It is also convenient for recovery. - -## So many versions, how to choose? - -You can view the detailed [changelog](/en-US/changelog). The latest releases version is recommended. - -- Version rules - - Use two-level semantic version, such as v1, v1.1, v2, v2.1 - - v1 represents the initial version - - The fixes and additions to the v1 version will be released to the v1.1 version - - When the released v1.x runs stable for a certain period of time or undergoes refactoring, release the advanced v2.x version - - After the v2 version, the version will be released strictly according to the three-level semantics, such as v2.0.0, v2.1.0 - -- Version selection - - It is recommended to use the latest releases version. It can be seen in [releases](https://github.com/actions-cool/issues-helper/releases) - - You can also refer to the update log below to select the version - - The latest v1.x release code will be merged into the 1.x branch - - After the v2 version, the v2 tag is supported, and the latest 2.x code will be synchronized - - It also supports the direct use of branch versions. Such as: - -```yml -- name: Issues Helper - uses: actions-cool/issues-helper@main - -# or - -- name: Issues Helper - uses: actions-cool/issues-helper@1.x - -# or - -- name: Issues Helper - uses: actions-cool/issues-helper@v2 -``` - -## What should I pay attention to when upgrading from v1.x to v2? - -There is only one difference between v1.12 and v2.0.0. That is, `require-permission` in `mark-duplicate` has added the default value `write`. - -## v3 changelog - -🚀 The refactoring of the v3 version is completed. The main changes are: - -1. JS to TS -2. Encapsulate the core functions of the issue into classes for helpers to use -3. Unified prompt information -4. Added automatic release script - -Reference for functional changes: - -- 🚀 New Feature - - `mark-assignees`: Comment quick settings assignees - - `find-issues`: Conditional query current warehouse issues -- 🐞 Bug Fix - - Fixed `find-comments` return result direction not working - - Fix `lock-issues` lock and comment order issue -- 🛠 Refactor - - `contents` renamed to easy-to-understand `emoji` - - `issue-emojis` renamed to `issue-emoji` - - deleteComment updateComment no longer supports `out-comments`, keeping pure functionality - - Remove title body default - - `month-statistics` removed - -## What should I do if there is no function I want here? - -You can submit it in [What do you want?](https://github.com/actions-cool/issues-helper/discussions/18). diff --git a/web/docs/guide/faq.md b/web/docs/guide/faq.md index d99ccbd6..dc71099e 100644 --- a/web/docs/guide/faq.md +++ b/web/docs/guide/faq.md @@ -2,43 +2,43 @@ toc: menu --- -## 该功能是否收费? +## Is there a charge for this feature? -GitHub Actions 是由 GitHub 免费提供的。其中 `Private` 项目每月有 2000 次的限制,[具体查看](https://github.com/settings/billing)。`Public` 项目无限制。 +GitHub Actions is provided free of charge by GitHub. Among them, the `Private` project has a monthly limit of 2000 times, [see details](https://github.com/settings/billing). The `Public` project is unlimited. -### 有没有速率的限制? +### Is there a rate limit? -有的。Action 底层使用的是 GitHub REST API。一般情况是每小时 5000 次。原则上基本是够用的,同时也要求在 Action 定义时,尽量避免无效的请求。[具体查看](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting)。 +Yes. The bottom layer of Action uses GitHub REST API. The general situation is 5000 times per hour. It is basically sufficient in principle, and it is also required to avoid invalid requests when defining Action. [Detailed view](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting). -## 有没有现成的模板可以参考? +## Are there any ready-made templates for reference? -有的。 +Yes. -1. 你可以使用这个 [GitHub Actions workflow template](https://github.com/actions-cool/.github) 仓库的模板 -2. 个人练习和测试 [Actions](https://github.com/actions-cool/test-issues-helper) 的仓库 -3. 也可以来 [线上使用者](/#-谁在使用?) 的仓库参照 +1. You can use this [GitHub Actions workflow template](https://github.com/actions-cool/.github) repository template +2. Personal exercises and tests [Actions](https://github.com/actions-cool/test-issues-helper) repository +3. You can also refer to the warehouse of [online users](#-who-is-using) -## 我想暂停 Actions,有没有简单的办法? +## I want to pause Actions, is there an easy way? -有的,你可以将直接修改 `actions`。例如:`actions: 'create-comment'` 修改为 `actions: '#create-comment'`。同时也方便恢复。 +Yes, you can directly modify `actions`. For example: `actions:'create-comment'` is changed to `actions:'#create-comment'`. It is also convenient for recovery. -## 这么多版本,如何选择? +## So many versions, how to choose? -你可以查看详细的 [更新日志](/changelog)。推荐采用最新 releases 版本。 +You can view the detailed [changelog](/changelog). The latest releases version is recommended. -- 版本规则 - - 采用两级语义化版本,如v1、v1.1、v2、v2.1 - - v1 表示初始版本 - - 对 v1 版本的修复和新增会发布到 v1.1 版本 - - 当发布的 v1.x 运行一定时间稳定或进行重构时,发布进阶 v2.x 版本 - - v2 版本后会严格按照三级语义来发布版本,如 v2.0.0、v2.1.0 +- Version rules + - Use two-level semantic version, such as v1, v1.1, v2, v2.1 + - v1 represents the initial version + - The fixes and additions to the v1 version will be released to the v1.1 version + - When the released v1.x runs stable for a certain period of time or undergoes refactoring, release the advanced v2.x version + - After the v2 version, the version will be released strictly according to the three-level semantics, such as v2.0.0, v2.1.0 -- 版本选择 - - 建议采用最新 releases 版本。可在 [releases](https://github.com/actions-cool/issues-helper/releases) 看到 - - 同时也可参照下面的更新日志来选择版本 - - 最新的 v1.x release 代码会合并到 1.x 分支中 - - v2 版本后支持使用 v2 tag,将同步最新 2.x 代码 - - 支持直接使用分支版本。如: +- Version selection + - It is recommended to use the latest releases version. It can be seen in [releases](https://github.com/actions-cool/issues-helper/releases) + - You can also refer to the update log below to select the version + - The latest v1.x release code will be merged into the 1.x branch + - After the v2 version, the v2 tag is supported, and the latest 2.x code will be synchronized + - It also supports the direct use of branch versions. Such as: ```yml - name: Issues Helper @@ -52,37 +52,37 @@ GitHub Actions 是由 GitHub 免费提供的。其中 `Private` 项目每月有 # or - name: Issues Helper - uses: actions-cool/issues-helper@v3 + uses: actions-cool/issues-helper@v2 ``` -## 从 v1.x 升级到 v2,有什么注意的地方吗? +## What should I pay attention to when upgrading from v1.x to v2? -v1.12 和 v2.0.0 版本的差别只有一处。即 `mark-duplicate` 中的 `require-permission` 增加了默认值 `write`。 +There is only one difference between v1.12 and v2.0.0. That is, `require-permission` in `mark-duplicate` has added the default value `write`. -## v3 变更 +## v3 changelog -🚀 v3 版本重构完成,主要变更内容: +🚀 The refactoring of the v3 version is completed. The main changes are: 1. JS to TS -2. 将 issue 核心功能封装成为类供 helper 使用 -3. 提示信息统一 -4. 增加自动发布脚本 +2. Encapsulate the core functions of the issue into classes for helpers to use +3. Unified prompt information +4. Added automatic release script -功能变更参考: +Reference for functional changes: - 🚀 New Feature - - `mark-assignees`: 评论快捷设置 assignees - - `find-issues`: 条件查询当前仓库 issues + - `mark-assignees`: Comment quick settings assignees + - `find-issues`: Conditional query current warehouse issues - 🐞 Bug Fix - - 修复 `find-comments` 返回结果 direction 未起作用 - - 修复 `lock-issues` lock 与 comment 的顺序问题 + - Fixed `find-comments` return result direction not working + - Fix `lock-issues` lock and comment order issue - 🛠 Refactor - - contents 更名为容易理解的 emoji - - `issue-emojis` 更名为 `issue-emoji` - - deleteComment updateComment 不再支持 `out-comments`,保持纯粹功能 - - 移除 title body 默认值 - - `month-statistics` 移除 + - `contents` renamed to easy-to-understand `emoji` + - `issue-emojis` renamed to `issue-emoji` + - deleteComment updateComment no longer supports `out-comments`, keeping pure functionality + - Remove title body default + - `month-statistics` removed -## 如果这里没有我想要的功能,该怎么办? +## What should I do if there is no function I want here? -你可以在 issues 中提出。 +You can submit it in [What do you want?](https://github.com/actions-cool/issues-helper/discussions/18). diff --git a/web/docs/guide/faq.zh-CN.md b/web/docs/guide/faq.zh-CN.md new file mode 100644 index 00000000..20e77037 --- /dev/null +++ b/web/docs/guide/faq.zh-CN.md @@ -0,0 +1,88 @@ +--- +toc: menu +--- + +## 该功能是否收费? + +GitHub Actions 是由 GitHub 免费提供的。其中 `Private` 项目每月有 2000 次的限制,[具体查看](https://github.com/settings/billing)。`Public` 项目无限制。 + +### 有没有速率的限制? + +有的。Action 底层使用的是 GitHub REST API。一般情况是每小时 5000 次。原则上基本是够用的,同时也要求在 Action 定义时,尽量避免无效的请求。[具体查看](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting)。 + +## 有没有现成的模板可以参考? + +有的。 + +1. 你可以使用这个 [GitHub Actions workflow template](https://github.com/actions-cool/.github) 仓库的模板 +2. 个人练习和测试 [Actions](https://github.com/actions-cool/test-issues-helper) 的仓库 +3. 也可以来 [线上使用者](/zh-CN/#-谁在使用?) 的仓库参照 + +## 我想暂停 Actions,有没有简单的办法? + +有的,你可以将直接修改 `actions`。例如:`actions: 'create-comment'` 修改为 `actions: '#create-comment'`。同时也方便恢复。 + +## 这么多版本,如何选择? + +你可以查看详细的 [更新日志](/zh-CN/changelog)。推荐采用最新 releases 版本。 + +- 版本规则 + - 采用两级语义化版本,如v1、v1.1、v2、v2.1 + - v1 表示初始版本 + - 对 v1 版本的修复和新增会发布到 v1.1 版本 + - 当发布的 v1.x 运行一定时间稳定或进行重构时,发布进阶 v2.x 版本 + - v2 版本后会严格按照三级语义来发布版本,如 v2.0.0、v2.1.0 + +- 版本选择 + - 建议采用最新 releases 版本。可在 [releases](https://github.com/actions-cool/issues-helper/releases) 看到 + - 同时也可参照下面的更新日志来选择版本 + - 最新的 v1.x release 代码会合并到 1.x 分支中 + - v2 版本后支持使用 v2 tag,将同步最新 2.x 代码 + - 支持直接使用分支版本。如: + +```yml +- name: Issues Helper + uses: actions-cool/issues-helper@main + +# or + +- name: Issues Helper + uses: actions-cool/issues-helper@1.x + +# or + +- name: Issues Helper + uses: actions-cool/issues-helper@v3 +``` + +## 从 v1.x 升级到 v2,有什么注意的地方吗? + +v1.12 和 v2.0.0 版本的差别只有一处。即 `mark-duplicate` 中的 `require-permission` 增加了默认值 `write`。 + +## v3 变更 + +🚀 v3 版本重构完成,主要变更内容: + +1. JS to TS +2. 将 issue 核心功能封装成为类供 helper 使用 +3. 提示信息统一 +4. 增加自动发布脚本 + +功能变更参考: + +- 🚀 New Feature + - `mark-assignees`: 评论快捷设置 assignees + - `find-issues`: 条件查询当前仓库 issues +- 🐞 Bug Fix + - 修复 `find-comments` 返回结果 direction 未起作用 + - 修复 `lock-issues` lock 与 comment 的顺序问题 +- 🛠 Refactor + - contents 更名为容易理解的 emoji + - `issue-emojis` 更名为 `issue-emoji` + - deleteComment updateComment 不再支持 `out-comments`,保持纯粹功能 + - 移除 title body 默认值 + - `month-statistics` 移除 + +## 如果这里没有我想要的功能,该怎么办? + +你可以在 issues 中提出。 diff --git a/web/docs/guide/index.en-US.md b/web/docs/guide/index.en-US.md deleted file mode 100644 index 6e090d98..00000000 --- a/web/docs/guide/index.en-US.md +++ /dev/null @@ -1,23 +0,0 @@ -## Introduction - -The Issues Helper is a GitHub Action that easily helps you automatically manage issues. - -### What are GitHub Actions? - -Automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, and share actions to perform any job you'd like, including CI/CD, and combine actions in a completely customized workflow. [More](https://docs.github.com/en/free-pro-team@latest/actions). - -`issues-helper` is based on this, using GitHub Actions to help you deal with various operations on issues. - -### ✨ Feature - -- 😎 Complete free -- 🚀 Fully automatic -- 🏖 Hosted on the GitHub server, as long as GitHub is not down, it is not affected - -### ⚡ Feedback - -You are very welcome to try it out and put forward your comments. You can use the following methods: - -- Report bugs or consult with [Issue](https://github.com/actions-cool/issues-helper/issues) -- Discuss via [Discussions](https://github.com/actions-cool/issues-helper/discussions) -- Submit [Pull Request](https://github.com/actions-cool/issues-helper/pulls) to improve the code of `issues-helper` diff --git a/web/docs/guide/index.md b/web/docs/guide/index.md index 2e9781c4..6e090d98 100644 --- a/web/docs/guide/index.md +++ b/web/docs/guide/index.md @@ -1,23 +1,23 @@ -## 介 绍 +## Introduction -Issues 助手是一个轻松帮你自动管理 issues 的 GitHub Action。 +The Issues Helper is a GitHub Action that easily helps you automatically manage issues. -### GitHub Actions 是什么? +### What are GitHub Actions? -GitHub Actions 是由 GitHub 官方提供在存储库中自动化、自定义和执行软件开发工作流程。您可以发现,创建和共享操作以执行所需的任何工作(包括CI / CD),并在完全定制的工作流程中组合操作。[更多介绍](https://docs.github.com/en/free-pro-team@latest/actions)。 +Automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, and share actions to perform any job you'd like, including CI/CD, and combine actions in a completely customized workflow. [More](https://docs.github.com/en/free-pro-team@latest/actions). -`issues-helper` 就是以此为基础,利用 GitHub Actions 来帮你处理各种关于 issue 方面的操作。 +`issues-helper` is based on this, using GitHub Actions to help you deal with various operations on issues. -### ✨ 特性 +### ✨ Feature -- 😎 完全免费 -- 🚀 全自动操作 -- 🏖 托管于 GitHub 服务器,只要 GitHub 不宕机,它就不受影响 +- 😎 Complete free +- 🚀 Fully automatic +- 🏖 Hosted on the GitHub server, as long as GitHub is not down, it is not affected -### ⚡ 反馈 +### ⚡ Feedback -非常欢迎你来尝试使用,并提出意见,你可以通过以下方式: +You are very welcome to try it out and put forward your comments. You can use the following methods: -- 通过 [Issue](https://github.com/actions-cool/issues-helper/issues) 报告 bug 或进行咨询 -- 通过 [Discussions](https://github.com/actions-cool/issues-helper/discussions) 进行讨论 -- 提交 [Pull Request](https://github.com/actions-cool/issues-helper/pulls) 改进 `issues-helper` 的代码 +- Report bugs or consult with [Issue](https://github.com/actions-cool/issues-helper/issues) +- Discuss via [Discussions](https://github.com/actions-cool/issues-helper/discussions) +- Submit [Pull Request](https://github.com/actions-cool/issues-helper/pulls) to improve the code of `issues-helper` diff --git a/web/docs/guide/index.zh-CN.md b/web/docs/guide/index.zh-CN.md new file mode 100644 index 00000000..2e9781c4 --- /dev/null +++ b/web/docs/guide/index.zh-CN.md @@ -0,0 +1,23 @@ +## 介 绍 + +Issues 助手是一个轻松帮你自动管理 issues 的 GitHub Action。 + +### GitHub Actions 是什么? + +GitHub Actions 是由 GitHub 官方提供在存储库中自动化、自定义和执行软件开发工作流程。您可以发现,创建和共享操作以执行所需的任何工作(包括CI / CD),并在完全定制的工作流程中组合操作。[更多介绍](https://docs.github.com/en/free-pro-team@latest/actions)。 + +`issues-helper` 就是以此为基础,利用 GitHub Actions 来帮你处理各种关于 issue 方面的操作。 + +### ✨ 特性 + +- 😎 完全免费 +- 🚀 全自动操作 +- 🏖 托管于 GitHub 服务器,只要 GitHub 不宕机,它就不受影响 + +### ⚡ 反馈 + +非常欢迎你来尝试使用,并提出意见,你可以通过以下方式: + +- 通过 [Issue](https://github.com/actions-cool/issues-helper/issues) 报告 bug 或进行咨询 +- 通过 [Discussions](https://github.com/actions-cool/issues-helper/discussions) 进行讨论 +- 提交 [Pull Request](https://github.com/actions-cool/issues-helper/pulls) 改进 `issues-helper` 的代码 diff --git a/web/docs/guide/note.en-US.md b/web/docs/guide/note.en-US.md deleted file mode 100644 index 7c0d4150..00000000 --- a/web/docs/guide/note.en-US.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -toc: menu ---- - - -Here are some things I summarized in my use, I hope it can help you. - - -## Include judgment in `yml` - -```yml -if: contains(github.event.issue.body, 'ie') == false -``` -- Triggered when the issue body does not contain `ie` -- The js `includes()` syntax is not supported in the yml -- Case is not checked, `IE` and also similar to `kiekk` can also be satisfied - -[More](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#functions). - -## Pass value and output in `yml` - -``` -with: - actions: 'month-statistics' - token: ${{ secrets.GITHUB_TOKEN }} - count-lables: 'true' -``` - -- `count-lables`: Regardless of setting `true` or `'ture'`, all received in the program is in string format - -At the same time, the output is also in string format. [See](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs). - -- `check-result`: The judgment condition is `if: steps.xxid.outputs.check-result =='true'` - -## `GitHub Actions bot` trigger - -When an action is set, such as adding a label `x1` to an issue, Actions will automatically add a label `x2` to the issue. - -But if this is done by `GitHub Actions bot` (that is, the token in the actions is not passed, or the default `token: ${{ secrets.GITHUB_TOKEN }}` is used), the actions of label `x2` will not be triggered. - -ref: [GitHub docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token) - -## `assignees` scope - -- The owner or collaborator of the warehouse, if there is an organization, including members -- Participants of the issue, including creators and commenters -- Max 10 - -## Benchmark - -For example: I use a Tag to trigger an Action, and the code that triggers the benchmark will follow the Action definition of the code corresponding to this Tag instead of the main branch code. diff --git a/web/docs/guide/note.md b/web/docs/guide/note.md index 54abe4ac..7c0d4150 100644 --- a/web/docs/guide/note.md +++ b/web/docs/guide/note.md @@ -3,22 +3,21 @@ toc: menu --- -这里记录自己在使用中总结的一些东西,希望可以帮助到你。 +Here are some things I summarized in my use, I hope it can help you. -## `yml` 中包含判断 +## Include judgment in `yml` ```yml if: contains(github.event.issue.body, 'ie') == false ``` +- Triggered when the issue body does not contain `ie` +- The js `includes()` syntax is not supported in the yml +- Case is not checked, `IE` and also similar to `kiekk` can also be satisfied -- 当 issue body 不包含 `ie` 触发 -- 测试 yml 中不支持 js `includes()` 语法 -- 大小写不校验,`IE` 还有同时类似 `kiekk` 也可满足 +[More](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#functions). -更多[查看](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#functions)。 - -## `yml` 中传值和输出 +## Pass value and output in `yml` ``` with: @@ -27,26 +26,26 @@ with: count-lables: 'true' ``` -- `count-lables`:不管设置 `true` 还是 `'ture'`,在程序里接收到的都是字符串格式 +- `count-lables`: Regardless of setting `true` or `'ture'`, all received in the program is in string format -同时输出的也是字符串格式。[参看](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs)。 +At the same time, the output is also in string format. [See](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs). -- `check-result`:判断条件为 `if: steps.xxid.outputs.check-result == 'true'` +- `check-result`: The judgment condition is `if: steps.xxid.outputs.check-result =='true'` -## `GitHub Actions bot` 触发 +## `GitHub Actions bot` trigger -当设置了一个 Actions,如为给一个 issue 新增 label `x1` 时,Actions 自动为该 issue 增加 `x2` label。 +When an action is set, such as adding a label `x1` to an issue, Actions will automatically add a label `x2` to the issue. -但如果这个是由 `GitHub Actions bot` 完成的(即 actions 中 token 不传,或使用默认 `token: ${{ secrets.GITHUB_TOKEN }}`),则不会触发 label `x2` 的 Actions。 +But if this is done by `GitHub Actions bot` (that is, the token in the actions is not passed, or the default `token: ${{ secrets.GITHUB_TOKEN }}` is used), the actions of label `x2` will not be triggered. ref: [GitHub docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token) -## `assignees` 范围 +## `assignees` scope -- 仓库的所有者或协作者,若有组织,包括成员 -- issue 的参与者,包括创建者、评论者 -- 最多支持 10 个 +- The owner or collaborator of the warehouse, if there is an organization, including members +- Participants of the issue, including creators and commenters +- Max 10 -## 运行基准 +## Benchmark -比如:我用 Tag 触发一个 Action,触发基准的代码就会走这个 Tag 对应代码的 Action 定义,而非主分支代码。 +For example: I use a Tag to trigger an Action, and the code that triggers the benchmark will follow the Action definition of the code corresponding to this Tag instead of the main branch code. diff --git a/web/docs/guide/note.zh-CN.md b/web/docs/guide/note.zh-CN.md new file mode 100644 index 00000000..54abe4ac --- /dev/null +++ b/web/docs/guide/note.zh-CN.md @@ -0,0 +1,52 @@ +--- +toc: menu +--- + + +这里记录自己在使用中总结的一些东西,希望可以帮助到你。 + + +## `yml` 中包含判断 + +```yml +if: contains(github.event.issue.body, 'ie') == false +``` + +- 当 issue body 不包含 `ie` 触发 +- 测试 yml 中不支持 js `includes()` 语法 +- 大小写不校验,`IE` 还有同时类似 `kiekk` 也可满足 + +更多[查看](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#functions)。 + +## `yml` 中传值和输出 + +``` +with: + actions: 'month-statistics' + token: ${{ secrets.GITHUB_TOKEN }} + count-lables: 'true' +``` + +- `count-lables`:不管设置 `true` 还是 `'ture'`,在程序里接收到的都是字符串格式 + +同时输出的也是字符串格式。[参看](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs)。 + +- `check-result`:判断条件为 `if: steps.xxid.outputs.check-result == 'true'` + +## `GitHub Actions bot` 触发 + +当设置了一个 Actions,如为给一个 issue 新增 label `x1` 时,Actions 自动为该 issue 增加 `x2` label。 + +但如果这个是由 `GitHub Actions bot` 完成的(即 actions 中 token 不传,或使用默认 `token: ${{ secrets.GITHUB_TOKEN }}`),则不会触发 label `x2` 的 Actions。 + +ref: [GitHub docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token) + +## `assignees` 范围 + +- 仓库的所有者或协作者,若有组织,包括成员 +- issue 的参与者,包括创建者、评论者 +- 最多支持 10 个 + +## 运行基准 + +比如:我用 Tag 触发一个 Action,触发基准的代码就会走这个 Tag 对应代码的 Action 定义,而非主分支代码。 diff --git a/web/docs/guide/ref.en-US.md b/web/docs/guide/ref.en-US.md deleted file mode 100644 index 931cbd19..00000000 --- a/web/docs/guide/ref.en-US.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -toc: menu ---- - -## 📍 `token` - -Need to have the person token with push permission. - -- [Personal token application](https://github.com/settings/tokens) - - Need to check `Full control of private repositories` -- Project add secrets - - Select settings, select secrets, select `New repository secret` - - `Name` is the same as in actions - - `Value` fill in the token just applied by the individual - -When the token is not filled in actions or input `${{ secrets.GITHUB_TOKEN }}`, it will default to `github-actions-bot`. [More](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow). - -## 📍 GitHub Docs - -- [Workflow syntax for GitHub Actions](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#on) -- [Events that trigger workflows](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows) - -## 📍 `outputs` use - -```yml -- name: Create issue - uses: actions-cool/issues-helper@v1 - id: createissue - with: - actions: 'create-issue' - token: ${{ secrets.GITHUB_TOKEN }} -- name: Check outputs - run: echo "Outputs issue_number is ${{ steps.createissue.outputs.issue-number }}" -``` - -More: - -1. https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs -2. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs - -## 📍 `includes` check rules - -```js -"title-includes": 'x1,x2' - -x1 -x2 - -"x1y3y2" true -"y2 x1" true -"x2" true -"x3" false -``` - -```js -"title-includes": 'x1,x2/y1,y2' - -x1 + y1 -x2 + y1 -x1 + y2 -x2 + y2 - -"x1y3y2" true -"y2 x1" true -"1x2y" false -"x1" false -``` - -## 📍 `emoji` Type - -| content | emoji | -| -- | -- | -| `+1` | 👍 | -| `-1` | 👎 | -| `laugh` | 😄 | -| `confused` | 😕 | -| `heart` | ❤️ | -| `hooray` | 🎉 | -| `rocket` | 🚀 | -| `eyes` | 👀 | - -For details, please [view](https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions). - -## 📍 `comment-id` - -Click the `···` icon in the upper right corner of a comment, select `Copy link`, and the number at the end of the url is `comment_id`. diff --git a/web/docs/guide/ref.md b/web/docs/guide/ref.md index 08a9624a..931cbd19 100644 --- a/web/docs/guide/ref.md +++ b/web/docs/guide/ref.md @@ -2,25 +2,25 @@ toc: menu --- -## 📍 `token` 说明 +## 📍 `token` -需拥有 push 权限的人员 token。 +Need to have the person token with push permission. -- [个人 token 申请](https://github.com/settings/tokens) - - 需勾选 `Full control of private repositories` -- 项目添加 secrets - - 选择 settings,选择 secrets,选择 `New repository secret` - - `Name` 与 actions 中保持一致 - - `Value` 填写刚才个人申请的 token +- [Personal token application](https://github.com/settings/tokens) + - Need to check `Full control of private repositories` +- Project add secrets + - Select settings, select secrets, select `New repository secret` + - `Name` is the same as in actions + - `Value` fill in the token just applied by the individual -当 actions 不填写 token 时,或输入 `${{ secrets.GITHUB_TOKEN }}`,会默认为 `github-actions-bot`。[更多查看](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow)。 +When the token is not filled in actions or input `${{ secrets.GITHUB_TOKEN }}`, it will default to `github-actions-bot`. [More](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow). -## 📍 GitHub 相关文档 +## 📍 GitHub Docs -- [GitHub Actions 语法](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#on) -- [工作流触发机制](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows) +- [Workflow syntax for GitHub Actions](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#on) +- [Events that trigger workflows](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows) -## 📍 `outputs` 使用 +## 📍 `outputs` use ```yml - name: Create issue @@ -33,12 +33,12 @@ toc: menu run: echo "Outputs issue_number is ${{ steps.createissue.outputs.issue-number }}" ``` -更多查看: +More: 1. https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs 2. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs -## 📍 `includes` 校验规则 +## 📍 `includes` check rules ```js "title-includes": 'x1,x2' @@ -66,7 +66,7 @@ x2 + y2 "x1" false ``` -## 📍 `emoji` 类型 +## 📍 `emoji` Type | content | emoji | | -- | -- | @@ -79,8 +79,8 @@ x2 + y2 | `rocket` | 🚀 | | `eyes` | 👀 | -如需详细了解,可 [查看](https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions)。 +For details, please [view](https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions). ## 📍 `comment-id` -点击某个评论右上角 `···` 图标,选择 `Copy link`,url 末尾数字即是 `comment_id`。 +Click the `···` icon in the upper right corner of a comment, select `Copy link`, and the number at the end of the url is `comment_id`. diff --git a/web/docs/guide/ref.zh-CN.md b/web/docs/guide/ref.zh-CN.md new file mode 100644 index 00000000..08a9624a --- /dev/null +++ b/web/docs/guide/ref.zh-CN.md @@ -0,0 +1,86 @@ +--- +toc: menu +--- + +## 📍 `token` 说明 + +需拥有 push 权限的人员 token。 + +- [个人 token 申请](https://github.com/settings/tokens) + - 需勾选 `Full control of private repositories` +- 项目添加 secrets + - 选择 settings,选择 secrets,选择 `New repository secret` + - `Name` 与 actions 中保持一致 + - `Value` 填写刚才个人申请的 token + +当 actions 不填写 token 时,或输入 `${{ secrets.GITHUB_TOKEN }}`,会默认为 `github-actions-bot`。[更多查看](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow)。 + +## 📍 GitHub 相关文档 + +- [GitHub Actions 语法](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#on) +- [工作流触发机制](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows) + +## 📍 `outputs` 使用 + +```yml +- name: Create issue + uses: actions-cool/issues-helper@v1 + id: createissue + with: + actions: 'create-issue' + token: ${{ secrets.GITHUB_TOKEN }} +- name: Check outputs + run: echo "Outputs issue_number is ${{ steps.createissue.outputs.issue-number }}" +``` + +更多查看: + +1. https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs +2. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs + +## 📍 `includes` 校验规则 + +```js +"title-includes": 'x1,x2' + +x1 +x2 + +"x1y3y2" true +"y2 x1" true +"x2" true +"x3" false +``` + +```js +"title-includes": 'x1,x2/y1,y2' + +x1 + y1 +x2 + y1 +x1 + y2 +x2 + y2 + +"x1y3y2" true +"y2 x1" true +"1x2y" false +"x1" false +``` + +## 📍 `emoji` 类型 + +| content | emoji | +| -- | -- | +| `+1` | 👍 | +| `-1` | 👎 | +| `laugh` | 😄 | +| `confused` | 😕 | +| `heart` | ❤️ | +| `hooray` | 🎉 | +| `rocket` | 🚀 | +| `eyes` | 👀 | + +如需详细了解,可 [查看](https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions)。 + +## 📍 `comment-id` + +点击某个评论右上角 `···` 图标,选择 `Copy link`,url 末尾数字即是 `comment_id`。 diff --git a/web/docs/guide/start.en-US.md b/web/docs/guide/start.en-US.md deleted file mode 100644 index a5d21522..00000000 --- a/web/docs/guide/start.en-US.md +++ /dev/null @@ -1,67 +0,0 @@ -## Quick start - -### 1. New Action - -Click Actions in the warehouse, if Actions have been added, the following interface will be displayed. - -![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*D5dMQLk2pI0AAAAAAAAAAAAAARQnAQ) - -Click `New workflow` to add. - -![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*cClPRIW6HKcAAAAAAAAAAAAAARQnAQ) - - -You can click set up a workflow yourself to add a custom action, or you can apply a new action based on a template. Templates. - - -### 2. Edit Action - -Actions storage address is fixed, unified as `/.github/workflows/xx.yml`. - -Let's take the example of the home page and explain it in detail. The corresponding scenario is: when an issue adds the `help wanted` tag, the system will automatically comment. - -```yml -name: Issue Reply - -on: - issues: - types: [labeled] - -jobs: - reply-helper: - runs-on: ubuntu-latest - steps: - - name: help wanted - if: github.event.label.name == 'help wanted' - uses: actions-cool/issues-helper@v3 - with: - actions: 'create-comment' - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - body: | - Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome PR。 - - 你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎PR。 -``` -- `YML` syntax reference - - [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#about-yaml-syntax-for-workflows) -- `name`: The workflow name - - Actions workflow name, can be customized according to actual situation -- `on`: The action trigger condition - - Reference [Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows) -- `uses`: Use actions name - - `uses: actions-cool/issues-helper@v2.0.0`。Please [refer](/en-US/changelog) to version selection -- `issues-hepler` parameter - - `actions`: The name of the function used, **required**. Support multiple, separated by commas, such as `create-comment,close-issue` means comment and close issue - - `token`: A person who needs to have push permission token - - [More view](/en-US/guide/ref#-token) - - `issue-number`: Incoming parameter, here means the number of the current issue. If you are confused about the writing, you can [view](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context) - - `body`: Incoming parameters, here means the content of the current comment - -### 3. Enable Action - -When you finish writing and submit to the master branch, you can automatically enable the workflow, and the trigger conditions follow the definition of `on`. - -😏 I believe that you have a general understanding of `how to use`, do you want to try it quickly? - -Please check the functions you need in [Basic](/en-US/base) and [Advanced](/en-US/advanced) for flexible reference. diff --git a/web/docs/guide/start.md b/web/docs/guide/start.md index 5f685de7..234f9925 100644 --- a/web/docs/guide/start.md +++ b/web/docs/guide/start.md @@ -1,24 +1,24 @@ -## 快速开始 +## Quick start -### 1. 新建 Action +### 1. New Action -点击仓库的 Actions,若已增加过 Actions,会显示如下界面。 +Click Actions in the warehouse, if Actions have been added, the following interface will be displayed. ![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*D5dMQLk2pI0AAAAAAAAAAAAAARQnAQ) -点击 `New workflow` 新增。 +Click `New workflow` to add. ![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*cClPRIW6HKcAAAAAAAAAAAAAARQnAQ) -你可以点击 set up a workflow yourself 新增一个自定义 action,也可以根据模板来套用新增一个 action。模板使用。 +You can click set up a workflow yourself to add a custom action, or you can apply a new action based on a template. Templates. -### 2. 编写 Action +### 2. Edit Action -Actions 存放地址是固定的,统一为 `/.github/workflows/xx.yml`。 +Actions storage address is fixed, unified as `/.github/workflows/xx.yml`. -下面拿首页的例子详细说明下。对应场景为:当一个 issue 新增 `help wanted` 标签时,系统会自动进行评论。 +Let's take the example of the home page and explain it in detail. The corresponding scenario is: when an issue adds the `help wanted` tag, the system will automatically comment. ```yml name: Issue Reply @@ -43,25 +43,25 @@ jobs: 你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎PR。 ``` -- `YML` 语法参考 - - [GitHub Actions 语法](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#about-yaml-syntax-for-workflows) -- `name`:workflow 名称 - - Actions 流程名称,可根据实际情况自定义 -- `on`:action 触发条件 - - 参考 [工作流触发机制](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows) -- `uses`:使用 actions 名称 - - `uses: actions-cool/issues-helper@v2.0.0`。版本选择请 [参考](/changelog) -- `issues-hepler` 参数 - - `actions`:使用功能的名称,**必填**。支持多个,需用逗号隔开,如 `create-comment,close-issue` 表示评论和关闭 issue - - `token`:需拥有 push 权限的人员 token - - 更多 [参考](/guide/ref#-token-说明) - - `issue-number`:传入参数,这里表示当前 issue 的编号。如果你对写法疑惑,可 [查看](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context) - - `body`:传入参数,这里表示当前进行评论的内容 - -### 3. 启用 Action - -当你完成编写完成提交到主分支后,即可自动启用该 workflow,触发条件遵循 `on` 的定义。 - -😏 相信到这里你已经对 `如何使用` 有了大概的了解,是不是想快点尝试一下。 - -下面请在 [基 础](/base) 和 [进 阶](/advanced) 查看你需要的功能,灵活参考。 +- `YML` syntax reference + - [Workflow syntax for GitHub Actions](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#about-yaml-syntax-for-workflows) +- `name`: The workflow name + - Actions workflow name, can be customized according to actual situation +- `on`: The action trigger condition + - Reference [Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows) +- `uses`: Use actions name + - `uses: actions-cool/issues-helper@v2.0.0`。Please [refer](/changelog) to version selection +- `issues-hepler` parameter + - `actions`: The name of the function used, **required**. Support multiple, separated by commas, such as `create-comment,close-issue` means comment and close issue + - `token`: A person who needs to have push permission token + - [More view](/guide/ref#-token) + - `issue-number`: Incoming parameter, here means the number of the current issue. If you are confused about the writing, you can [view](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context) + - `body`: Incoming parameters, here means the content of the current comment + +### 3. Enable Action + +When you finish writing and submit to the master branch, you can automatically enable the workflow, and the trigger conditions follow the definition of `on`. + +😏 I believe that you have a general understanding of `how to use`, do you want to try it quickly? + +Please check the functions you need in [Basic](/base) and [Advanced](/advanced) for flexible reference. diff --git a/web/docs/guide/start.zh-CN.md b/web/docs/guide/start.zh-CN.md new file mode 100644 index 00000000..837c7247 --- /dev/null +++ b/web/docs/guide/start.zh-CN.md @@ -0,0 +1,67 @@ +## 快速开始 + +### 1. 新建 Action + +点击仓库的 Actions,若已增加过 Actions,会显示如下界面。 + +![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*D5dMQLk2pI0AAAAAAAAAAAAAARQnAQ) + +点击 `New workflow` 新增。 + +![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*cClPRIW6HKcAAAAAAAAAAAAAARQnAQ) + + +你可以点击 set up a workflow yourself 新增一个自定义 action,也可以根据模板来套用新增一个 action。模板使用。 + + +### 2. 编写 Action + +Actions 存放地址是固定的,统一为 `/.github/workflows/xx.yml`。 + +下面拿首页的例子详细说明下。对应场景为:当一个 issue 新增 `help wanted` 标签时,系统会自动进行评论。 + +```yml +name: Issue Reply + +on: + issues: + types: [labeled] + +jobs: + reply-helper: + runs-on: ubuntu-latest + steps: + - name: help wanted + if: github.event.label.name == 'help wanted' + uses: actions-cool/issues-helper@v3 + with: + actions: 'create-comment' + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome PR。 + + 你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎PR。 +``` +- `YML` 语法参考 + - [GitHub Actions 语法](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#about-yaml-syntax-for-workflows) +- `name`:workflow 名称 + - Actions 流程名称,可根据实际情况自定义 +- `on`:action 触发条件 + - 参考 [工作流触发机制](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows) +- `uses`:使用 actions 名称 + - `uses: actions-cool/issues-helper@v2.0.0`。版本选择请 [参考](/zh-CN/changelog) +- `issues-hepler` 参数 + - `actions`:使用功能的名称,**必填**。支持多个,需用逗号隔开,如 `create-comment,close-issue` 表示评论和关闭 issue + - `token`:需拥有 push 权限的人员 token + - 更多 [参考](/zh-CN/guide/ref#-token-说明) + - `issue-number`:传入参数,这里表示当前 issue 的编号。如果你对写法疑惑,可 [查看](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context) + - `body`:传入参数,这里表示当前进行评论的内容 + +### 3. 启用 Action + +当你完成编写完成提交到主分支后,即可自动启用该 workflow,触发条件遵循 `on` 的定义。 + +😏 相信到这里你已经对 `如何使用` 有了大概的了解,是不是想快点尝试一下。 + +下面请在 [基 础](/zh-CN/base) 和 [进 阶](/zh-CN/advanced) 查看你需要的功能,灵活参考。 diff --git a/web/docs/index.md b/web/docs/index.md index 7207d7fd..207cd41a 100644 --- a/web/docs/index.md +++ b/web/docs/index.md @@ -1,29 +1,29 @@ --- -title: Issues 助手 +title: Issues Helper order: 1 hero: - title: Issues 助手 + title: Issues Helper image: https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*8xDgSL-O6O4AAAAAAAAAAAAAARQnAQ - desc: 🤖 一个轻松帮你自动管理 issues 的 GitHub Action + desc: 🤖 A GitHub Action that easily helps you automatically manage issues actions: - - text: 快速开始 + - text: Quick start link: /guide/start features: - icon: https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*Km0BQJs7vWAAAAAAAAAAAAAAARQnAQ - title: 完全免费 - desc: 使用 GitHub 自带提供的 Actions 服务 + title: Completely free + desc: Use the Actions service provided by GitHub - icon: https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*ELKWSIMizH0AAAAAAAAAAAAAARQnAQ - title: 简单易用 - desc: 教程详细,模版丰富 + title: Easy to use + desc: Detailed tutorials and rich templates - icon: https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*j-SURo-DkyIAAAAAAAAAAAAAARQnAQ - title: 轻松托管 - desc: 只要 GitHub 不宕机,它就不受影响 + title: Easy hosting + desc: As long as GitHub is not down, it will not be affected footer: Open-source MIT Licensed | Copyright © 2020-present
Powered by xrkffgg --- -## 🍭 快速上手 +## 🍭 Get started quickly -这里列举一个非常简单以及常用的例子。对应场景为:当一个 issue 新增 `help wanted` 标签时,系统会自动进行评论。 +Here is a very simple and commonly used example. The corresponding scenario is: when an issue adds the `help wanted` tag, the system will automatically comment. ```yml name: Issue Reply @@ -49,18 +49,14 @@ jobs: 你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎PR。 ``` -## 💖 谁在使用? +## 💖 Who is using? -## ⚡ 反馈 +## ⚡ Feedback -非常欢迎你来尝试使用,并提出意见,你可以通过以下方式: +You are very welcome to try it out and put forward your comments. You can use the following methods: -- 通过 [Issue](https://github.com/actions-cool/issues-helper/issues) 报告 bug 或进行咨询 -- 通过 [Discussions](https://github.com/actions-cool/issues-helper/discussions) 进行讨论 -- 提交 [Pull Request](https://github.com/actions-cool/issues-helper/pulls) 改进 `issues-helper` 的代码 - -也欢迎加入 钉钉交流群 - -![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*-iuDSpF7QAQAAAAAAAAAAAAAARQnAQ) +- Report bugs or consult with [Issue](https://github.com/actions-cool/issues-helper/issues) +- Discuss via [Discussions](https://github.com/actions-cool/issues-helper/discussions) +- Submit [Pull Request](https://github.com/actions-cool/issues-helper/pulls) to improve the code of `issues-helper` diff --git a/web/docs/index.en-US.md b/web/docs/index.zh-CN.md similarity index 52% rename from web/docs/index.en-US.md rename to web/docs/index.zh-CN.md index 6b56c6a2..1c0089c7 100644 --- a/web/docs/index.en-US.md +++ b/web/docs/index.zh-CN.md @@ -1,29 +1,29 @@ --- -title: Issues Helper +title: Issues 助手 order: 1 hero: - title: Issues Helper + title: Issues 助手 image: https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*8xDgSL-O6O4AAAAAAAAAAAAAARQnAQ - desc: 🤖 A GitHub Action that easily helps you automatically manage issues + desc: 🤖 一个轻松帮你自动管理 issues 的 GitHub Action actions: - - text: Quick start - link: /en-US/guide/start + - text: 快速开始 + link: /zh-CN/guide/start features: - icon: https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*Km0BQJs7vWAAAAAAAAAAAAAAARQnAQ - title: Completely free - desc: Use the Actions service provided by GitHub + title: 完全免费 + desc: 使用 GitHub 自带提供的 Actions 服务 - icon: https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*ELKWSIMizH0AAAAAAAAAAAAAARQnAQ - title: Easy to use - desc: Detailed tutorials and rich templates + title: 简单易用 + desc: 教程详细,模版丰富 - icon: https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*j-SURo-DkyIAAAAAAAAAAAAAARQnAQ - title: Easy hosting - desc: As long as GitHub is not down, it will not be affected + title: 轻松托管 + desc: 只要 GitHub 不宕机,它就不受影响 footer: Open-source MIT Licensed | Copyright © 2020-present
Powered by xrkffgg --- -## 🍭 Get started quickly +## 🍭 快速上手 -Here is a very simple and commonly used example. The corresponding scenario is: when an issue adds the `help wanted` tag, the system will automatically comment. +这里列举一个非常简单以及常用的例子。对应场景为:当一个 issue 新增 `help wanted` 标签时,系统会自动进行评论。 ```yml name: Issue Reply @@ -49,14 +49,18 @@ jobs: 你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎PR。 ``` -## 💖 Who is using? +## 💖 谁在使用? -## ⚡ Feedback +## ⚡ 反馈 -You are very welcome to try it out and put forward your comments. You can use the following methods: +非常欢迎你来尝试使用,并提出意见,你可以通过以下方式: -- Report bugs or consult with [Issue](https://github.com/actions-cool/issues-helper/issues) -- Discuss via [Discussions](https://github.com/actions-cool/issues-helper/discussions) -- Submit [Pull Request](https://github.com/actions-cool/issues-helper/pulls) to improve the code of `issues-helper` +- 通过 [Issue](https://github.com/actions-cool/issues-helper/issues) 报告 bug 或进行咨询 +- 通过 [Discussions](https://github.com/actions-cool/issues-helper/discussions) 进行讨论 +- 提交 [Pull Request](https://github.com/actions-cool/issues-helper/pulls) 改进 `issues-helper` 的代码 + +也欢迎加入 钉钉交流群 + +![](https://gw.alipayobjects.com/mdn/rms_f97235/afts/img/A*-iuDSpF7QAQAAAAAAAAAAAAAARQnAQ)