mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-19 18:25:58 +08:00
1009 lines
32 KiB
Markdown
1009 lines
32 KiB
Markdown
# 🤖 Issues Helper
|
|
|
|
[简体中文](./README.md) | English
|
|
|
|
[](https://github.com/actions-cool/issues-helper/actions)
|
|
[](https://github.com/marketplace/actions/issues-helper)
|
|
[](https://github.com/umijs/dumi)
|
|
[](https://github.com/actions-cool/issues-helper/releases)
|
|
[](https://github.com/actions-cool/issues-helper/discussions)
|
|
[](https://github.com/actions-cool/issues-helper/stargazers)
|
|
[](https://github.com/actions-cool/issues-helper/blob/main/LICENSE)
|
|
|
|
A GitHub Action that easily helps you automatically manage issues
|
|
|
|
[Online documentation](https://actions-cool.github.io/issues-helper) | [Changelog](https://github.com/actions-cool/issues-helper/blob/main/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.
|
|
|
|
## List
|
|
|
|
When the following list does not have the features you want, you can submit it in [What do you want?](https://github.com/actions-cool/issues-helper/discussions/18).
|
|
|
|
- ⭐ Base
|
|
- [`add-assignees`](#add-assignees)
|
|
- [`add-labels`](#add-labels)
|
|
- [`close-issue`](#close-issue)
|
|
- [`create-comment`](#create-comment)
|
|
- [`create-issue`](#create-issue)
|
|
- [`delete-comment`](#delete-comment)
|
|
- [`lock-issue`](#lock-issue)
|
|
- [`mark-duplicate`](#mark-duplicate)
|
|
- [`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)
|
|
- [`welcome`](#welcome)
|
|
- ⭐ Advanced
|
|
- [`check-inactive`](#check-inactive)
|
|
- [`check-issue`](#check-issue)
|
|
- [`close-issues`](#close-issues)
|
|
- [`find-comments`](#find-comments)
|
|
- [`lock-issues`](#lock-issues)
|
|
- 🌰 Example
|
|
- [`find-comments + create-comment + update-comment`](#find-comments--create-comment--update-comment)
|
|
|
|
## 🚀 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@v1
|
|
with:
|
|
actions: 'add-assignees'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue-number: ${{ github.event.issue.number }}
|
|
assignees: 'xxx' or 'xx1,xx2'
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| issue-number | The number of issue | number | ✔ | v1 |
|
|
| assignees | Designated person. No operation when no input or empty character | string | ✖ | v1.1 |
|
|
|
|
- `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. Pay attention to multiple settings, you need to use the version above v1.1
|
|
|
|
⏫ [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@v1
|
|
with:
|
|
actions: 'add-labels'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue-number: ${{ github.event.issue.number }}
|
|
labels: 'bug' or 'xx1,xx2'
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| issue-number | The number of issue | number | ✔ | v1 |
|
|
| labels | New labels. When it is not filled in or is empty character, do not add | string | ✖ | v1.1 |
|
|
|
|
- `labels` support multiple and separated by comma. Pay attention to multiple settings, you need to use the version above v1.1
|
|
|
|
⏫ [Back to list](#List)
|
|
|
|
#### `close-issue`
|
|
|
|
Close the specified issue.
|
|
|
|
```yml
|
|
- name: Close issue
|
|
uses: actions-cool/issues-helper@v1
|
|
with:
|
|
actions: 'close-issue'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue-number: xxx
|
|
body: 'This is auto closed.'
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| issue-number | The number of issue | number | ✔ | v1 |
|
|
|
|
⏫ [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@v1
|
|
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 }}。巴拉巴拉。
|
|
contents: '+1' or '+1,heart'
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| issue-number | The number of issue | number | ✔ | v1 |
|
|
| body | Add comment content | string | ✖ | v1 |
|
|
| contents | Add [reaction](#reactions-types) | string | ✖ | v1.1 |
|
|
|
|
- `body` default is `Currently at ${owner}/${repo}. And this is default comment.`
|
|
- Where `${owner}/${repo}` means the current repo
|
|
- 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
|
|
- `contents` support multiple and separated by comma. Pay attention to multiple settings, you need to use the version above v1.1
|
|
|
|
⏫ [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@v1
|
|
with:
|
|
actions: 'create-issue'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
title: 'xxxx'
|
|
body: 'xxxx'
|
|
labels: 'xx'
|
|
assignees: 'xxx'
|
|
contents: '+1'
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| title | The title of the new issue | string | ✖ | v1 |
|
|
| body | The body of the new issue | string | ✖ | v1 |
|
|
| labels | The labels for the new issue | string | ✖ | v1.1 |
|
|
| assignees | The assignees for the new issue | string | ✖ | v1.1 |
|
|
| contents | Add [reaction](#reactions-types) | string | ✖ | v1.1 |
|
|
|
|
- `title` default is `Default Title`
|
|
- Return `issue-number`. [Usage reference](#outputs-use)
|
|
|
|
⏫ [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@v1
|
|
with:
|
|
actions: 'delete-comment'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
comment-id: xxx
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| comment-id | The comment ID | number | ✔ | v1 |
|
|
|
|
⏫ [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@v1
|
|
with:
|
|
actions: 'lock-issue'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue-number: ${{ github.event.issue.number }}
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| issue-number | The number of issue | number | ✔ | v1 |
|
|
|
|
⏫ [Back to list](#List)
|
|
|
|
#### `mark-duplicate`
|
|
|
|
Quickly 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@v1.5
|
|
with:
|
|
actions: 'mark-duplicate'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1.5 |
|
|
| token | [Token explain](#token) | string | ✔ | v1.5 |
|
|
| duplicate-command | Operation command, default is `/d` | string | ✖ | v1.5 |
|
|
| duplicate-labels | Add additional labels to this issue | string | ✖ | v1.5 |
|
|
| labels | Replace the labels of the issue | string | ✖ | v1.5 |
|
|
| contents | Add [reaction](#reactions-types) for this comment | string | ✖ | v1.5 |
|
|
|
|
⏫ [返回列表](#列-表)
|
|
|
|
#### `open-issue`
|
|
|
|
Open the specified issue.
|
|
|
|
```yml
|
|
- name: Open issue
|
|
uses: actions-cool/issues-helper@v1
|
|
with:
|
|
actions: 'open-issue'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue-number: xxx
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| issue-number | The number of issue | number | ✔ | v1 |
|
|
|
|
⏫ [Back to list](#List)
|
|
|
|
#### `remove-assignees`
|
|
|
|
Remove the person designated by issue.
|
|
|
|
```yml
|
|
- name: Remove assignees
|
|
uses: actions-cool/issues-helper@v1
|
|
with:
|
|
actions: 'remove-assignees'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue-number: ${{ github.event.issue.number }}
|
|
assignees: 'xx'
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| issue-number | The number of issue | number | ✔ | v1 |
|
|
| assignees | Designated person removed. When it is an empty character, do not remove | string | ✔ | v1.1 |
|
|
|
|
⏫ [Back to list](#List)
|
|
|
|
#### `remove-labels`
|
|
|
|
Remove the specified labels.
|
|
|
|
```yml
|
|
- name: Remove labels
|
|
uses: actions-cool/issues-helper@v1.2
|
|
with:
|
|
actions: 'remove-labels'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue-number: ${{ github.event.issue.number }}
|
|
labels: 'xx'
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1.2 |
|
|
| token | [Token explain](#token) | string | ✔ | v1.2 |
|
|
| issue-number | The number of issue | number | ✔ | v1.2 |
|
|
| labels | The removed labels. When it is a blank character, do not remove | string | ✔ | v1.2 |
|
|
|
|
- `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@v1
|
|
with:
|
|
actions: 'set-labels'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue-number: ${{ github.event.issue.number }}
|
|
labels: 'xx'
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| issue-number | The number of issue | number | ✔ | v1 |
|
|
| labels | labels set. When empty characters, will remove all | string | ✔ | v1.1 |
|
|
|
|
⏫ [Back to list](#List)
|
|
|
|
#### `unlock-issue`
|
|
|
|
Unlock the specified issue.
|
|
|
|
```yml
|
|
- name: Unlock issue
|
|
uses: actions-cool/issues-helper@v1
|
|
with:
|
|
actions: 'unlock-issue'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue-number: ${{ github.event.issue.number }}
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| issue-number | The number of issue | number | ✔ | v1 |
|
|
|
|
⏫ [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@v1
|
|
with:
|
|
actions: 'update-comment'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
comment-id: ${{ github.event.comment.id }}
|
|
contents: 'eyes'
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| comment-id | The comment ID | number | ✔ | v1 |
|
|
| body | Update the content of comment | string | ✖ | v1 |
|
|
| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | v1 |
|
|
| contents | Add [reaction](#reactions-types) | string | ✖ | v1.1 |
|
|
|
|
- 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@v1
|
|
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'
|
|
contents: '+1'
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| issue-number | The number of issue | number | ✔ | v1 |
|
|
| state | Modify the status of issue, optional value `open` `closed` | string | ✖ | v1 |
|
|
| title | Modify the title of the issue | string | ✖ | v1 |
|
|
| body | Modify the content of issue | string | ✖ | v1 |
|
|
| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | v1 |
|
|
| labels | Replace the labels of issue | string | ✖ | v1.1 |
|
|
| assignees | Replace the assignees of issue | string | ✖ | v1.1 |
|
|
| contents | Add [reaction](#reactions-types) | string | ✖ | v1.1 |
|
|
|
|
- `state` defaults to `open`
|
|
- When the option is not filled, it will keep the original
|
|
|
|
⏫ [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@v1.3
|
|
with:
|
|
actions: 'welcome'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
body: hi @${{ github.event.issue.user.login }}, welcome!
|
|
labels: 'welcome1, welcome2'
|
|
assignees: 'xx1'
|
|
issue-contents: '+1, -1, eyes'
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1.3 |
|
|
| token | [Token explain](#token) | string | ✔ | v1.3 |
|
|
| body | Comment on the welcome content, no comment if you leave it blank | string | ✖ | v1.3 |
|
|
| labels | Add labels to this issue | string | ✖ | v1.3 |
|
|
| assignees | Add assignees to this issue | string | ✖ | v1.3 |
|
|
| issue-contents | Add [reaction](#reactions-types) to this issue| string | ✖ | v1.3 |
|
|
|
|
- If these 4 options are not filled, no operation
|
|
|
|
⏫ [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@v1
|
|
with:
|
|
actions: 'check-inactive'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
inactive-day: 30
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | v1 |
|
|
| contents | Add [reaction](#reactions-types) for this comment | string | ✖ | v1 |
|
|
| labels | Labels filtering | string | ✖ | v1.1 |
|
|
| issue-state | State filtering | string | ✖ | v1 |
|
|
| issue-assignee | Assignee filtering | string | ✖ | v1 |
|
|
| issue-creator | Creator filtering | string | ✖ | v1 |
|
|
| issue-mentioned | Mentioned filtering | string | ✖ | v1 |
|
|
| body-includes | Body filtering | string | ✖ | v1 |
|
|
| title-includes | Title filtering | string | ✖ | v1 |
|
|
| inactive-day | Inactive days filtering | number | ✖ | v1.4 |
|
|
| inactive-label | The label name adding | string | ✖ | v1 |
|
|
|
|
- `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
|
|
|
|
⏫ [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@v1
|
|
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 | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1.2 |
|
|
| token | [Token explain](#token) | string | ✔ | v1.2 |
|
|
| issue-number | The number of issue | number | ✔ | v1.2 |
|
|
| assignee-includes | Assignees contains check | string | ✖ | v1.2 |
|
|
| title-includes | Title contains check | string | ✖ | v1.2 |
|
|
| body-includes | Body contains check | string | ✖ | v1.2 |
|
|
|
|
- `title-includes` `body-includes` supports the format `x1,x2` or `x1,x2/y1,y2`. Only supports two levels
|
|
- Return `check-result`
|
|
|
|
⏫ [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@v1
|
|
with:
|
|
actions: 'close-issues'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
labels: 'need info'
|
|
inactive-day: 7
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | v1 |
|
|
| contents | Add [reaction](#reactions-types) for this comment | string | ✖ | v1 |
|
|
| labels | Labels filtering | string | ✖ | v1.1 |
|
|
| issue-assignee | Assignee filtering | string | ✖ | v1 |
|
|
| issue-creator | Creator filtering | string | ✖ | v1 |
|
|
| issue-mentioned | Mentioned filtering | string | ✖ | v1 |
|
|
| body-includes | Body filtering | string | ✖ | v1 |
|
|
| title-includes | Title filtering | string | ✖ | v1 |
|
|
| inactive-day | Inactive days filtering | number | ✖ | v1.4 |
|
|
|
|
- `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
|
|
|
|
⏫ [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@v1
|
|
with:
|
|
actions: 'find-comments'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue-number: 1
|
|
comment-auth: 'k'
|
|
body-includes: 'this'
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| issue-number | The number of issue | number | ✔ | v1 |
|
|
| comment-auth | Comment creator, all will be queried if not filled | string | ✖ | v1 |
|
|
| body-includes | Comment content includes filtering, no verification if not filled | string | ✖ | v1 |
|
|
| direction | Return `comments` sort | string | ✖ | v1 |
|
|
|
|
- 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)
|
|
|
|
#### `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@v1
|
|
with:
|
|
actions: 'lock-issues'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
labels: 'inactive'
|
|
inactive-day: 128
|
|
```
|
|
|
|
| Param | Desc | Type | Required | Version |
|
|
| -- | -- | -- | -- | -- |
|
|
| actions | Action type | string | ✔ | v1 |
|
|
| token | [Token explain](#token) | string | ✔ | v1 |
|
|
| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | v1 |
|
|
| contents | Add [reaction](#reactions-types) for this comment | string | ✖ | v1 |
|
|
| labels | Labels filtering | string | ✖ | v1.1 |
|
|
| issue-state | State filtering | string | ✖ | v1 |
|
|
| issue-assignee | Assignee filtering | string | ✖ | v1 |
|
|
| issue-creator | Creator filtering | string | ✖ | v1 |
|
|
| issue-mentioned | Mentioned filtering | string | ✖ | v1 |
|
|
| body-includes | Body filtering | string | ✖ | v1 |
|
|
| title-includes | Title filtering | string | ✖ | v1 |
|
|
| inactive-day | Inactive days filtering | number | ✖ | v1.4 |
|
|
|
|
- `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
|
|
|
|
⏫ [Back to list](#List)
|
|
|
|
## 🌰 Example
|
|
|
|
Flexible reference.
|
|
|
|
### `find-comments + create-comment + update-comment`
|
|
|
|
Hypothetical scenario: When the issue modification of the `watch` label is added, find out whether there is a comment containing `error` created by k, if there is only one, update the comment, if not, add a new comment.
|
|
|
|
```yml
|
|
name: Test
|
|
|
|
on:
|
|
isssue:
|
|
types: [edited]
|
|
|
|
jobs:
|
|
do-test:
|
|
runs-on: ubuntu-latest
|
|
if: github.event.label.name == 'watch'
|
|
steps:
|
|
- name: find comments
|
|
uses: actions-cool/issues-helper@v1
|
|
id: fcid
|
|
with:
|
|
actions: 'find-comments'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue-number: ${{ github.event.issue.number }}
|
|
comment-auth: k
|
|
body-includes: 'error'
|
|
|
|
- name: create comment
|
|
if: ${{ steps.fcid.outputs.comments.length == 0 }}
|
|
uses: actions-cool/issues-helper@v1
|
|
with:
|
|
actions: 'create-comment'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue-number: ${{ github.event.issue.number }}
|
|
body: 'Some error!'
|
|
|
|
- name: update comment
|
|
if: ${{ steps.fcid.outputs.comments.length == 1 }}
|
|
uses: actions-cool/issues-helper@v1
|
|
with:
|
|
actions: 'update-comment'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
comment-id: ${{ steps.fcid.outputs.comments[0].id }}
|
|
body: 'Some error again!'
|
|
update-mode: 'append'
|
|
```
|
|
|
|
⏫ [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 the corresponding secrets are not added to the project, it will default to github-actions <kbd>bot</kbd>. [More](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow).
|
|
|
|
⏫ [Back to list](#List)
|
|
|
|
### `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](https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs).
|
|
|
|
### 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)
|
|
|
|
### 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)
|
|
### Reactions 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)
|
|
|
|
## ✨ Version
|
|
|
|
- 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, release the advanced v2 version
|
|
- The parameters in the API must use the largest version and above
|
|
|
|
- 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
|
|
- It also supports the direct use of branch versions. Such as:
|
|
|
|
```yml
|
|
- name: Issues Helper
|
|
uses: actions-cool/issues-helper@main
|
|
```
|
|
|
|
## 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/xrkffgg/test-ci) repository
|
|
|
|
## 💖 Who is using?
|
|
|
|
You can come to the following repositories for reference. Please leave a message at [**here**](https://github.com/actions-cool/issues-helper/issues/6).
|
|
|
|
At the same time, if you have any questions during use, you can also ask and inquire in the issue or discussion.
|
|
|
|
<table>
|
|
<tr>
|
|
<td align="center">
|
|
<a href="https://github.com/ant-design/ant-design">
|
|
<img src="https://avatars1.githubusercontent.com/u/12101536?s=200&v=4" width="46" />
|
|
</a>
|
|
</td>
|
|
<td align="center">
|
|
<a href="https://github.com/vueComponent/ant-design-vue">
|
|
<img src="https://avatars2.githubusercontent.com/u/32120805?s=200&v=4" width="46" />
|
|
</a>
|
|
</td>
|
|
<td align="center">
|
|
<a href="https://github.com/umijs/dumi">
|
|
<img src="https://avatars2.githubusercontent.com/u/33895495?s=200&v=4" width="46" />
|
|
</a>
|
|
</td>
|
|
<td align="center">
|
|
<a href="https://github.com/umijs/umi">
|
|
<img src="https://avatars2.githubusercontent.com/u/33895495?s=200&v=4" width="46" />
|
|
</a>
|
|
</td>
|
|
<td align="center">
|
|
<a href="https://github.com/AttoJS/vue-request">
|
|
<img src="https://raw.githubusercontent.com/AttoJS/art/master/vue-request-logo.png" width="46" />
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="160">
|
|
<strong>ant-design</strong>
|
|
</td>
|
|
<td align="center" width="160">
|
|
<strong>ant-design-vue</strong>
|
|
</td>
|
|
<td align="center" width="160">
|
|
<strong>dumi</strong>
|
|
</td>
|
|
<td align="center" width="160">
|
|
<strong>umi</strong>
|
|
</td>
|
|
<td align="center" width="160">
|
|
<strong>vue-request</strong>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
## LICENSE
|
|
|
|
[MIT](https://github.com/actions-cool/issues-helper/blob/main/LICENSE)
|