Compare commits

...

21 Commits
v1.5 ... v1.8

Author SHA1 Message Date
xrkffgg
b7db679f4b docs: update doc 2021-01-07 17:41:52 +08:00
xrkffgg
0cbadbacfa chore: update dist 2021-01-07 17:35:01 +08:00
xrkffgg
1ce7be88a0 Delete check-dist.yml 2021-01-07 17:31:42 +08:00
xrkffgg
53dda7f0e4 🤖 auto: updated dist 2021-01-07 09:15:22 +00:00
xrkffgg
026e812e04 refactor: split content & add remove labels (#31)
* refactor: split content & add remove labels

* add

* add

* opt inactive check

* up web

* addadd

* change version

* add style

* add less
2021-01-07 17:14:32 +08:00
xrkffgg
986730477b docs: add users (#30)
* docs: add users

* add

* add
2021-01-05 20:29:09 +08:00
xrkffgg
9984ee0402 🤖 auto: updated dist 2021-01-04 05:57:39 +00:00
xrkffgg
dae9d88636 docs: optimize website (#29)
* docs: optimize website

* a

* a
2021-01-04 13:56:48 +08:00
xrkffgg
7879d79201 chore: remove no use 2021-01-03 11:21:21 +08:00
xrkffgg
ed1da6607e docs: fix typo 2021-01-02 23:13:46 +08:00
xrkffgg
c70fbba1bd 🤖 auto: updated dist 2021-01-02 15:02:14 +00:00
xrkffgg
ffe8047e9a perf: update text 2021-01-02 23:01:24 +08:00
xrkffgg
d8f67aa451 docs: fix emoji 2021-01-02 22:51:52 +08:00
xrkffgg
c604486551 feat: add month-statistics && fix bug (#27)
* wip

* wip

* fix

* fix

* test

* test

* fix

* fix

* fix

* fix

* add

* opt

* update

* add changelog

* remove version

* fix

* a

* Update README.md

* a

* Update .umirc.dev.ts
2021-01-02 22:47:40 +08:00
xrkffgg
80c1fcca98 chore: add update-user (#26)
* chore: add update-user

* fix link
2020-12-31 22:23:41 +08:00
xrkffgg
dc73f4f963 Update README.en-US.md 2020-12-31 16:56:28 +08:00
xrkffgg
da4725492d chore: add gitee 2020-12-31 15:50:06 +08:00
xrkffgg
7668c4b549 docs: add gitee 2020-12-31 15:14:13 +08:00
xrkffgg
b769c20e3f chore: update site & dumi version (#25) 2020-12-31 14:27:48 +08:00
xrkffgg
44240d2ab3 docs: update changelog 2020-12-30 15:25:03 +08:00
xrkffgg
da1f8da3d4 perf: optimize duplicate (#24)
* perf: optimize mark duplicate

* add

* add

* add

* add

* add
2020-12-30 15:17:26 +08:00
38 changed files with 12788 additions and 1181 deletions

View File

@@ -8,11 +8,11 @@ First of all, thank you for your contribution! 😄
- [ ] 新特性提交 / New feature - [ ] 新特性提交 / New feature
- [ ] bug 修复 / Fix bug - [ ] bug 修复 / Fix bug
- [ ] 样式优化 / Style optimization - [ ] 样式优化 / Style optimization
- [ ] 包体积优化 / Package size optimization
- [ ] 性能优化 / Performance optimization
- [ ] 代码风格优化 / Code style optimization - [ ] 代码风格优化 / Code style optimization
- [ ] 性能优化 / Performance optimization
- [ ] 构建优化 / Build optimization - [ ] 构建优化 / Build optimization
- [ ] 网站、文档、Demo 改进 / Website, documentation, demo improvements - [ ] 网站、文档、Demo 改进 / Website, documentation, demo improvements
- [ ] 重构代码或样式 / Refactor code or style
- [ ] 测试相关 / Test related - [ ] 测试相关 / Test related
- [ ] 其他 / Other - [ ] 其他 / Other
@@ -42,7 +42,6 @@ Describe changes from the user side, and list all potential break changes or oth
| 🇺🇸 English | | | 🇺🇸 English | |
| 🇨🇳 Chinese | | | 🇨🇳 Chinese | |
### ☑️ 请求合并前的自查清单 / Self Check before Merge ### ☑️ 请求合并前的自查清单 / Self Check before Merge
⚠️ 请自检并全部**勾选全部选项**。/ Please check all items below before review. ⚠️ ⚠️ 请自检并全部**勾选全部选项**。/ Please check all items below before review. ⚠️

View File

@@ -1,27 +0,0 @@
name: Update dist
on:
push:
branches: [ main ]
jobs:
check-dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: install
run: yarn
- name: package
run: yarn package
- name: Commit and push if changed
run: |-
git diff
git config --global user.email "xrkffgg@vip.qq.com"
git config --global user.name "xrkffgg"
git pull
git add -A
git commit -m "🤖 auto: updated dist" || exit 0
git push

2
.gitignore vendored
View File

@@ -18,7 +18,7 @@ yarn-error.log*
# dependencies # dependencies
node_modules node_modules
yarn.lock # yarn.lock
package-lock.json package-lock.json
# local env files # local env files

View File

@@ -1,4 +1,4 @@
export default { export default {
base: '/', base: '/',
publicPath: '/', publicPath: '/'
}; };

View File

@@ -11,6 +11,7 @@ export default defineConfig({
logo: logo:
'https://avatars1.githubusercontent.com/u/73879334?s=200&v=4', 'https://avatars1.githubusercontent.com/u/73879334?s=200&v=4',
exportStatic: {}, exportStatic: {},
ssr: {},
outputPath: 'docs-dist', outputPath: 'docs-dist',
hash: true, hash: true,
base: `/${name}/`, base: `/${name}/`,
@@ -28,6 +29,7 @@ export default defineConfig({
{ title: '基 础', path: '/base' }, { title: '基 础', path: '/base' },
{ title: '进 阶', path: '/advanced' }, { title: '进 阶', path: '/advanced' },
{ title: '更新日志', path: '/changelog' }, { title: '更新日志', path: '/changelog' },
{ title: '国内镜像', path: 'https://issues-helper.gitee.io' },
{ title: 'GitHub', path: 'https://github.com/actions-cool/issues-helper' }, { title: 'GitHub', path: 'https://github.com/actions-cool/issues-helper' },
], ],
'en-US': [ 'en-US': [
@@ -45,9 +47,13 @@ export default defineConfig({
children: ['/guide/index', '/guide/start'], children: ['/guide/index', '/guide/start'],
}, },
{ {
title: '🎁 参 考', title: '🎁 参 考',
path: '/guide/ref', path: '/guide/ref',
}, },
{
title: '🎗 记 录',
path: '/guide/note',
},
{ {
title: '💬 FAQ', title: '💬 FAQ',
path: '/guide/faq', path: '/guide/faq',
@@ -59,24 +65,17 @@ export default defineConfig({
children: ['/guide/index', '/guide/start'], children: ['/guide/index', '/guide/start'],
}, },
{ {
title: '🎁 Reference', title: '🎁 Reference',
path: '/guide/ref', path: '/guide/ref',
}, },
{
title: '🎗 Note',
path: '/guide/note',
},
{ {
title: '💬 FAQ', title: '💬 FAQ',
path: '/guide/faq', path: '/guide/faq',
}, },
], ],
}, },
styles: [
`
.markdown table {
width: auto !important;
}
.__dumi-default-code-block + table {
margin-top: 16px;
}
`,
]
}); });

View File

@@ -1,3 +1,27 @@
## v1.8
`2021.01.07`
- [#31](https://github.com/actions-cool/issues-helper/pull/31)
- refactor: split content
- feat: add `remove-labels` for duplicate
- docs: optimize website
## v1.7
`2021.01.02`
- [#27](https://github.com/actions-cool/issues-helper/pull/27)
- feat: add `month-statistics`
- fix: query issues less because pages max 100
- fix: js nested `require`
## v1.6
`2020.12.30`
- perf: optimize duplicate. [#24](https://github.com/actions-cool/issues-helper/pull/24)
## v1.5 ## v1.5
`2020.12.30` `2020.12.30`

View File

@@ -43,12 +43,13 @@ When the following list does not have the features you want, you can submit it i
- [`update-comment`](#update-comment) - [`update-comment`](#update-comment)
- [`update-issue`](#update-issue) - [`update-issue`](#update-issue)
- [`welcome`](#welcome) - [`welcome`](#welcome)
- Advanced - 🌟 Advanced
- [`check-inactive`](#check-inactive) - [`check-inactive`](#check-inactive)
- [`check-issue`](#check-issue) - [`check-issue`](#check-issue)
- [`close-issues`](#close-issues) - [`close-issues`](#close-issues)
- [`find-comments`](#find-comments) - [`find-comments`](#find-comments)
- [`lock-issues`](#lock-issues) - [`lock-issues`](#lock-issues)
- [`month-statistics`](#month-statistics)
- 🌰 Example - 🌰 Example
- [`find-comments + create-comment + update-comment`](#find-comments--create-comment--update-comment) - [`find-comments + create-comment + update-comment`](#find-comments--create-comment--update-comment)
@@ -74,7 +75,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Add assigness - name: Add assigness
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'add-assignees' actions: 'add-assignees'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -82,18 +83,18 @@ jobs:
assignees: 'xxx' or 'xx1,xx2' assignees: 'xxx' or 'xx1,xx2'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| assignees | Designated person. No operation when no input or empty character | string | ✖ | v1.1 | | assignees | Designated person. No operation when no input or empty character | string | ✖ |
- `actions` support multiple and separated by comma. Like: `add-assignees,add-labels` - `actions` support multiple and separated by comma. Like: `add-assignees,add-labels`
- The `name` can be modified according to the actual situation - The `name` can be modified according to the actual situation
- [Reference to on](#github-docs) - [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) - `${{ 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 - `assignees` support multiple and separated by comma
⏫ [Back to list](#List) ⏫ [Back to list](#List)
@@ -114,7 +115,7 @@ jobs:
if: contains(github.event.issue.body, 'xxx') == false if: contains(github.event.issue.body, 'xxx') == false
steps: steps:
- name: Add labels - name: Add labels
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'add-labels' actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -122,14 +123,14 @@ jobs:
labels: 'bug' or 'xx1,xx2' labels: 'bug' or 'xx1,xx2'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| labels | New labels. When it is not filled in or is empty character, do not add | string | ✖ | v1.1 | | labels | New labels. When it is not filled in or is empty character, do not add | string | ✖ |
- `labels` support multiple and separated by comma. Pay attention to multiple settings, you need to use the version above v1.1 - `labels` support multiple and separated by comma
⏫ [Back to list](#List) ⏫ [Back to list](#List)
@@ -139,7 +140,7 @@ Close the specified issue.
```yml ```yml
- name: Close issue - name: Close issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'close-issue' actions: 'close-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -147,11 +148,11 @@ Close the specified issue.
body: 'This is auto closed.' body: 'This is auto closed.'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
⏫ [Back to list](#List) ⏫ [Back to list](#List)
@@ -172,7 +173,7 @@ jobs:
if: github.event.label.name == 'xxx' if: github.event.label.name == 'xxx'
steps: steps:
- name: Create comment - name: Create comment
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'create-comment' actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -184,19 +185,19 @@ jobs:
contents: '+1' or '+1,heart' contents: '+1' or '+1,heart'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| body | Add comment content | string | ✖ | v1 | | body | Add comment content | string | ✖ |
| contents | Add [reaction](#reactions-types) | string | ✖ | v1.1 | | contents | Add [reaction](#reactions-types) | string | ✖ |
- `body` default is `Currently at ${owner}/${repo}. And this is default comment.` - `body` default is `Currently at ${owner}/${repo}. And this is default comment.`
- Where `${owner}/${repo}` means the current repo - Where `${owner}/${repo}` means the current repo
- Return `comment-id`, which can be used for subsequent operations. [Usage reference](#outputs-use) - 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 - `${{ 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 - `contents` support multiple and separated by comma
⏫ [Back to list](#List) ⏫ [Back to list](#List)
@@ -216,7 +217,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Create issue - name: Create issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'create-issue' actions: 'create-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -227,15 +228,15 @@ jobs:
contents: '+1' contents: '+1'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| title | The title of the new issue | string | ✖ | v1 | | title | The title of the new issue | string | ✖ |
| body | The body of the new issue | string | ✖ | v1 | | body | The body of the new issue | string | ✖ |
| labels | The labels for the new issue | string | ✖ | v1.1 | | labels | The labels for the new issue | string | ✖ |
| assignees | The assignees for the new issue | string | ✖ | v1.1 | | assignees | The assignees for the new issue | string | ✖ |
| contents | Add [reaction](#reactions-types) | string | ✖ | v1.1 | | contents | Add [reaction](#reactions-types) | string | ✖ |
- `title` default is `Default Title` - `title` default is `Default Title`
- Return `issue-number`. [Usage reference](#outputs-use) - Return `issue-number`. [Usage reference](#outputs-use)
@@ -248,18 +249,18 @@ According to [`comment-id`](#comment-id) delete the specified comment.
```yml ```yml
- name: Delete comment - name: Delete comment
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'delete-comment' actions: 'delete-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
comment-id: xxx comment-id: xxx
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| comment-id | The comment ID | number | ✔ | v1 | | comment-id | The comment ID | number | ✔ |
⏫ [Back to list](#List) ⏫ [Back to list](#List)
@@ -280,53 +281,58 @@ jobs:
if: github.event.label.name == 'invalid' if: github.event.label.name == 'invalid'
steps: steps:
- name: Lock issue - name: Lock issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'lock-issue' actions: 'lock-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }} issue-number: ${{ github.event.issue.number }}
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
⏫ [Back to list](#List) ⏫ [Back to list](#List)
#### `mark-duplicate` #### `mark-duplicate`
Quickly mark duplicate issue. Quickly mark duplicate questions, only for issue new comments.
```yml ```yml
name: Issue Mark Duplicate name: Issue Mark Duplicate
on: on:
issue_comment: issue_comment:
types: [created, edited] types: [created]
jobs: jobs:
mark-duplicate: mark-duplicate:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: mark-duplicate - name: mark-duplicate
uses: actions-cool/issues-helper@v1.5 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'mark-duplicate' actions: 'mark-duplicate'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1.5 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1.5 | | token | [Token explain](#token) | string | ✔ |
| duplicate-command | Operation command, default is `/d` | string | ✖ | v1.5 | | duplicate-command | Simple commands can be set, such as: `/d` | string | ✖ |
| duplicate-labels | Add additional labels to this issue | string | ✖ | v1.5 | | duplicate-labels | Add additional labels to this issue | string | ✖ |
| labels | Replace the labels of the issue | string | ✖ | v1.5 | | remove-labels | Set removable labels | string | ✖ |
| contents | Add [reaction](#reactions-types) for this comment | string | ✖ | v1.5 | | labels | Replace the labels of the issue | string | ✖ |
| contents | Add [reaction](#reactions-types) for this comment | string | ✖ |
| close-issue | Whether to close the issue at the same time | string | ✖ |
⏫ [返回列表](#列-表) - `duplicate-command`: When setting concise commands, while still supporting the original `Duplicate of`
- `close-issue`: Both `true` or `'true'` can take effect
⏫ [Back to list](#List)
#### `open-issue` #### `open-issue`
@@ -334,18 +340,18 @@ Open the specified issue.
```yml ```yml
- name: Open issue - name: Open issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'open-issue' actions: 'open-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: xxx issue-number: xxx
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
⏫ [Back to list](#List) ⏫ [Back to list](#List)
@@ -355,7 +361,7 @@ Remove the person designated by issue.
```yml ```yml
- name: Remove assignees - name: Remove assignees
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'remove-assignees' actions: 'remove-assignees'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -363,12 +369,12 @@ Remove the person designated by issue.
assignees: 'xx' assignees: 'xx'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| assignees | Designated person removed. When it is an empty character, do not remove | string | ✔ | v1.1 | | assignees | Designated person removed. When it is an empty character, do not remove | string | ✔ |
⏫ [Back to list](#List) ⏫ [Back to list](#List)
@@ -378,7 +384,7 @@ Remove the specified labels.
```yml ```yml
- name: Remove labels - name: Remove labels
uses: actions-cool/issues-helper@v1.2 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'remove-labels' actions: 'remove-labels'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -386,12 +392,12 @@ Remove the specified labels.
labels: 'xx' labels: 'xx'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1.2 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1.2 | | token | [Token explain](#token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1.2 | | issue-number | The number of issue | number | ✔ |
| labels | The removed labels. When it is a blank character, do not remove | string | ✔ | v1.2 | | 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 - `labels` supports multiple, such as `x1,x2,x3`, only the labels added by the issue will be removed
@@ -403,7 +409,7 @@ Replace the labels of issue.
```yml ```yml
- name: Set labels - name: Set labels
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'set-labels' actions: 'set-labels'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -411,12 +417,12 @@ Replace the labels of issue.
labels: 'xx' labels: 'xx'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| labels | labels set. When empty characters, will remove all | string | ✔ | v1.1 | | labels | labels set. When empty characters, will remove all | string | ✔ |
⏫ [Back to list](#List) ⏫ [Back to list](#List)
@@ -426,18 +432,18 @@ Unlock the specified issue.
```yml ```yml
- name: Unlock issue - name: Unlock issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'unlock-issue' actions: 'unlock-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }} issue-number: ${{ github.event.issue.number }}
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
⏫ [Back to list](#List) ⏫ [Back to list](#List)
@@ -459,7 +465,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Update comment - name: Update comment
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'update-comment' actions: 'update-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -467,14 +473,14 @@ jobs:
contents: 'eyes' contents: 'eyes'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| comment-id | The comment ID | number | ✔ | v1 | | comment-id | The comment ID | number | ✔ |
| body | Update the content of comment | string | ✖ | v1 | | body | Update the content of comment | string | ✖ |
| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | v1 | | update-mode | Update mode. Default `replace`, another `append` | string | ✖ |
| contents | Add [reaction](#reactions-types) | string | ✖ | v1.1 | | contents | Add [reaction](#reactions-types) | string | ✖ |
- When `body` is not entered, it will remain as it is - 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 `update-mode` is `append`, additional operations will be performed. Anything other than `append` will be replaced. Only effective for `body`
@@ -487,7 +493,7 @@ Update the specified issue according to the `issue-number`.
```yml ```yml
- name: Update issue - name: Update issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'update-issue' actions: 'update-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -501,18 +507,18 @@ Update the specified issue according to the `issue-number`.
contents: '+1' contents: '+1'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| state | Modify the status of issue, optional value `open` `closed` | string | ✖ | v1 | | state | Modify the status of issue, optional value `open` `closed` | string | ✖ |
| title | Modify the title of the issue | string | ✖ | v1 | | title | Modify the title of the issue | string | ✖ |
| body | Modify the content of issue | string | ✖ | v1 | | body | Modify the content of issue | string | ✖ |
| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | v1 | | update-mode | Update mode. Default `replace`, another `append` | string | ✖ |
| labels | Replace the labels of issue | string | ✖ | v1.1 | | labels | Replace the labels of issue | string | ✖ |
| assignees | Replace the assignees of issue | string | ✖ | v1.1 | | assignees | Replace the assignees of issue | string | ✖ |
| contents | Add [reaction](#reactions-types) | string | ✖ | v1.1 | | contents | Add [reaction](#reactions-types) | string | ✖ |
- `state` defaults to `open` - `state` defaults to `open`
- When the option is not filled, it will keep the original - When the option is not filled, it will keep the original
@@ -537,7 +543,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: welcome - name: welcome
uses: actions-cool/issues-helper@v1.3 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'welcome' actions: 'welcome'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -547,14 +553,14 @@ jobs:
issue-contents: '+1, -1, eyes' issue-contents: '+1, -1, eyes'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1.3 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1.3 | | token | [Token explain](#token) | string | ✔ |
| body | Comment on the welcome content, no comment if you leave it blank | string | ✖ | v1.3 | | body | Comment on the welcome content, no comment if you leave it blank | string | ✖ |
| labels | Add labels to this issue | string | ✖ | v1.3 | | labels | Add labels to this issue | string | ✖ |
| assignees | Add assignees to this issue | string | ✖ | v1.3 | | assignees | Add assignees to this issue | string | ✖ |
| issue-contents | Add [reaction](#reactions-types) to this issue| string | ✖ | v1.3 | | issue-contents | Add [reaction](#reactions-types) to this issue| string | ✖ |
- If these 4 options are not filled, no operation - If these 4 options are not filled, no operation
@@ -580,28 +586,28 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: check-inactive - name: check-inactive
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'check-inactive' actions: 'check-inactive'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
inactive-day: 30 inactive-day: 30
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | v1 | | body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ |
| contents | Add [reaction](#reactions-types) for this comment | string | ✖ | v1 | | contents | Add [reaction](#reactions-types) for this comment | string | ✖ |
| labels | Labels filtering | string | ✖ | v1.1 | | labels | Labels filtering | string | ✖ |
| issue-state | State filtering | string | ✖ | v1 | | issue-state | State filtering | string | ✖ |
| issue-assignee | Assignee filtering | string | ✖ | v1 | | issue-assignee | Assignee filtering | string | ✖ |
| issue-creator | Creator filtering | string | ✖ | v1 | | issue-creator | Creator filtering | string | ✖ |
| issue-mentioned | Mentioned filtering | string | ✖ | v1 | | issue-mentioned | Mentioned filtering | string | ✖ |
| body-includes | Body filtering | string | ✖ | v1 | | body-includes | Body filtering | string | ✖ |
| title-includes | Title filtering | string | ✖ | v1 | | title-includes | Title filtering | string | ✖ |
| inactive-day | Inactive days filtering | number | ✖ | v1.4 | | inactive-day | Inactive days filtering | number | ✖ |
| inactive-label | The label name adding | string | ✖ | v1 | | inactive-label | The label name adding | string | ✖ |
- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all - `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-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all`
@@ -633,7 +639,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: check-issue - name: check-issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'check-issue' actions: 'check-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -642,17 +648,17 @@ jobs:
title-includes: 'x1,x2/y1,y2' title-includes: 'x1,x2/y1,y2'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1.2 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1.2 | | token | [Token explain](#token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1.2 | | issue-number | The number of issue | number | ✔ |
| assignee-includes | Assignees contains check | string | ✖ | v1.2 | | assignee-includes | Assignees contains check | string | ✖ |
| title-includes | Title contains check | string | ✖ | v1.2 | | title-includes | Title contains check | string | ✖ |
| body-includes | Body contains check | string | ✖ | v1.2 | | body-includes | Body contains check | string | ✖ |
- `title-includes` `body-includes` supports the format `x1,x2` or `x1,x2/y1,y2`. Only supports two levels - `title-includes` `body-includes` supports the format `x1,x2` or `x1,x2/y1,y2`. Only supports two levels
- Return `check-result` - Return `check-result`, due to yml reasons, the judgment condition is `if: steps.xxid.outputs.check-result =='true'`
⏫ [Back to list](#List) ⏫ [Back to list](#List)
@@ -672,7 +678,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: close-issues - name: close-issues
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'close-issues' actions: 'close-issues'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -680,19 +686,19 @@ jobs:
inactive-day: 7 inactive-day: 7
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | v1 | | body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ |
| contents | Add [reaction](#reactions-types) for this comment | string | ✖ | v1 | | contents | Add [reaction](#reactions-types) for this comment | string | ✖ |
| labels | Labels filtering | string | ✖ | v1.1 | | labels | Labels filtering | string | ✖ |
| issue-assignee | Assignee filtering | string | ✖ | v1 | | issue-assignee | Assignee filtering | string | ✖ |
| issue-creator | Creator filtering | string | ✖ | v1 | | issue-creator | Creator filtering | string | ✖ |
| issue-mentioned | Mentioned filtering | string | ✖ | v1 | | issue-mentioned | Mentioned filtering | string | ✖ |
| body-includes | Body filtering | string | ✖ | v1 | | body-includes | Body filtering | string | ✖ |
| title-includes | Title filtering | string | ✖ | v1 | | title-includes | Title filtering | string | ✖ |
| inactive-day | Inactive days filtering | number | ✖ | v1.4 | | inactive-day | Inactive days filtering | number | ✖ |
- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all - `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 - `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
@@ -706,7 +712,7 @@ Find the current warehouse issue No. 1, the creator is k and the content contain
```yml ```yml
- name: Find comments - name: Find comments
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'find-comments' actions: 'find-comments'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -715,14 +721,14 @@ Find the current warehouse issue No. 1, the creator is k and the content contain
body-includes: 'this' body-includes: 'this'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| comment-auth | Comment creator, all will be queried if not filled | string | ✖ | v1 | | comment-auth | Comment creator, all will be queried if not filled | string | ✖ |
| body-includes | Comment content includes filtering, no verification if not filled | string | ✖ | v1 | | body-includes | Comment content includes filtering, no verification if not filled | string | ✖ |
| direction | Return `comments` sort | string | ✖ | v1 | | direction | Return `comments` sort | string | ✖ |
- Return `comments` in the following format: - Return `comments` in the following format:
@@ -754,7 +760,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: lock-issues - name: lock-issues
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'lock-issues' actions: 'lock-issues'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -762,20 +768,20 @@ jobs:
inactive-day: 128 inactive-day: 128
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ | v1 | | token | [Token explain](#token) | string | ✔ |
| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | v1 | | body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ |
| contents | Add [reaction](#reactions-types) for this comment | string | ✖ | v1 | | contents | Add [reaction](#reactions-types) for this comment | string | ✖ |
| labels | Labels filtering | string | ✖ | v1.1 | | labels | Labels filtering | string | ✖ |
| issue-state | State filtering | string | ✖ | v1 | | issue-state | State filtering | string | ✖ |
| issue-assignee | Assignee filtering | string | ✖ | v1 | | issue-assignee | Assignee filtering | string | ✖ |
| issue-creator | Creator filtering | string | ✖ | v1 | | issue-creator | Creator filtering | string | ✖ |
| issue-mentioned | Mentioned filtering | string | ✖ | v1 | | issue-mentioned | Mentioned filtering | string | ✖ |
| body-includes | Body filtering | string | ✖ | v1 | | body-includes | Body filtering | string | ✖ |
| title-includes | Title filtering | string | ✖ | v1 | | title-includes | Title filtering | string | ✖ |
| inactive-day | Inactive days filtering | number | ✖ | v1.4 | | inactive-day | Inactive days filtering | number | ✖ |
- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all - `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-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all`
@@ -784,6 +790,44 @@ jobs:
⏫ [Back to list](#List) ⏫ [Back to list](#List)
#### `month-statistics`
At 1 o'clock on the 1st of each month, an issue is generated for the statistics of the previous month.
```
name: Issue Month Statistics
on:
schedule:
- cron: "0 1 1 * *"
jobs:
month-statistics:
runs-on: ubuntu-latest
steps:
- name: month-statistics
uses: actions-cool/issues-helper@v1.8
with:
actions: 'month-statistics'
token: ${{ secrets.GITHUB_TOKEN }}
count-lables: 'true'
```
| Param | Desc | Type | Required |
| -- | -- | -- | -- |
| actions | Action type | string | ✔ |
| token | [Token explain](#token) | string | ✔ |
| labels | The labels for the new issue | string | ✖ |
| assignees | The assignees for the new issue | string | ✖ |
| count-lables | Whether the new issue count labels | string | ✖ |
| count-comments | Whether the new issue count comments | string | ✖ |
- The new issue title defaults to `[Current repo] Month Statistics: Year-Month`
- `count-lables`: You can set `'true'` to add labels statistics
- `count-comments`: You can set `'true'` to add comments statistics
⏫ [Back to list](#List)
## 🌰 Example ## 🌰 Example
Flexible reference. Flexible reference.
@@ -805,7 +849,7 @@ jobs:
if: github.event.label.name == 'watch' if: github.event.label.name == 'watch'
steps: steps:
- name: find comments - name: find comments
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
id: fcid id: fcid
with: with:
actions: 'find-comments' actions: 'find-comments'
@@ -816,7 +860,7 @@ jobs:
- name: create comment - name: create comment
if: ${{ steps.fcid.outputs.comments.length == 0 }} if: ${{ steps.fcid.outputs.comments.length == 0 }}
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'create-comment' actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -825,7 +869,7 @@ jobs:
- name: update comment - name: update comment
if: ${{ steps.fcid.outputs.comments.length == 1 }} if: ${{ steps.fcid.outputs.comments.length == 1 }}
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'update-comment' actions: 'update-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -857,7 +901,7 @@ When the token is not filled in actions or the corresponding secrets are not add
```yml ```yml
- name: Create issue - name: Create issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
id: createissue id: createissue
with: with:
actions: 'create-issue' actions: 'create-issue'
@@ -932,7 +976,6 @@ Click the `···` icon in the upper right corner of a comment, select `Copy lin
- v1 represents the initial version - v1 represents the initial version
- The fixes and additions to the v1 version will be released to the v1.1 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 - 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 - 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) - It is recommended to use the latest releases version. It can be seen in [releases](https://github.com/actions-cool/issues-helper/releases)
@@ -957,50 +1000,52 @@ You can come to the following repositories for reference. Please leave a message
At the same time, if you have any questions during use, you can also ask and inquire in the issue or discussion. At the same time, if you have any questions during use, you can also ask and inquire in the issue or discussion.
<table> <table>
<tr> <tr>
<td align="center"> <td align="center" width="180">
<a href="https://github.com/ant-design/ant-design"> <a href="https://github.com/ant-design/ant-design">
<img src="https://avatars1.githubusercontent.com/u/12101536?s=200&v=4" width="46" /> <img src="https://avatars1.githubusercontent.com/u/12101536?s=200&v=4" width="46" />
</a> <br />
</td> ant-design
<td align="center"> </a></td>
<a href="https://github.com/vueComponent/ant-design-vue"> <td align="center" width="180">
<img src="https://avatars2.githubusercontent.com/u/32120805?s=200&v=4" width="46" /> <a href="https://github.com/vueComponent/ant-design-vue">
</a> <img src="https://avatars1.githubusercontent.com/u/32120805?s=200&v=4" width="46" />
</td> <br />
<td align="center"> ant-design-vue
<a href="https://github.com/umijs/dumi"> </a></td>
<img src="https://avatars2.githubusercontent.com/u/33895495?s=200&v=4" width="46" /> <td align="center" width="180">
</a> <a href="https://github.com/umijs/dumi">
</td> <img src="https://avatars1.githubusercontent.com/u/33895495?s=200&v=4" width="46" />
<td align="center"> <br />
<a href="https://github.com/umijs/umi"> dumi
<img src="https://avatars2.githubusercontent.com/u/33895495?s=200&v=4" width="46" /> </a></td>
</a> <td align="center" width="180">
</td> <a href="https://github.com/mui-org/material-ui">
<td align="center"> <img src="https://avatars2.githubusercontent.com/u/33663932?s=200&v=4" width="46" />
<a href="https://github.com/AttoJS/vue-request"> <br />
<img src="https://raw.githubusercontent.com/AttoJS/art/master/vue-request-logo.png" width="46" /> material-ui
</a> </a></td>
</td> </tr><tr>
</tr> <td align="center" width="180">
<tr> <a href="https://github.com/lijinke666/react-music-player">
<td align="center" width="160"> <img src="https://github.com/lijinke666/react-music-player/blob/master/assetsImg/logo.png?raw=true" width="46" />
<strong>ant-design</strong> <br />
</td> react-music-player
<td align="center" width="160"> </a></td>
<strong>ant-design-vue</strong> <td align="center" width="180">
</td> <a href="https://github.com/umijs/umi">
<td align="center" width="160"> <img src="https://avatars1.githubusercontent.com/u/33895495?s=200&v=4" width="46" />
<strong>dumi</strong> <br />
</td> umi
<td align="center" width="160"> </a></td>
<strong>umi</strong> <td align="center" width="180">
</td> <a href="https://github.com/AttoJS/vue-request">
<td align="center" width="160"> <img src="https://raw.githubusercontent.com/AttoJS/art/master/vue-request-logo.png" width="46" />
<strong>vue-request</strong> <br />
</td> vue-request
</tr> </a></td>
<td align="center" width="180"></td>
</tr>
</table> </table>
## LICENSE ## LICENSE

535
README.md
View File

@@ -12,7 +12,7 @@
一个轻松帮你自动管理 issues 的 GitHub Action 一个轻松帮你自动管理 issues 的 GitHub Action
[在线文档](https://actions-cool.github.io/issues-helper/) | [更新日志](https://github.com/actions-cool/issues-helper/blob/main/CHANGELOG.md) [在线文档](https://actions-cool.github.io/issues-helper/) | [更新日志](https://github.com/actions-cool/issues-helper/blob/main/CHANGELOG.md) | [国内镜像](https://issues-helper.gitee.io/)
## 😎 为什么用 GitHub Action ## 😎 为什么用 GitHub Action
@@ -43,12 +43,13 @@
- [`update-comment`](#update-comment) - [`update-comment`](#update-comment)
- [`update-issue`](#update-issue) - [`update-issue`](#update-issue)
- [`welcome`](#welcome) - [`welcome`](#welcome)
- 进 阶 - 🌟 进 阶
- [`check-inactive`](#check-inactive) - [`check-inactive`](#check-inactive)
- [`check-issue`](#check-issue) - [`check-issue`](#check-issue)
- [`close-issues`](#close-issues) - [`close-issues`](#close-issues)
- [`find-comments`](#find-comments) - [`find-comments`](#find-comments)
- [`lock-issues`](#lock-issues) - [`lock-issues`](#lock-issues)
- [`month-statistics`](#month-statistics)
- 🌰 例 子 - 🌰 例 子
- [`find-comments + create-comment + update-comment`](#find-comments--create-comment--update-comment) - [`find-comments + create-comment + update-comment`](#find-comments--create-comment--update-comment)
@@ -74,7 +75,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Add assigness - name: Add assigness
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'add-assignees' actions: 'add-assignees'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -82,18 +83,18 @@ jobs:
assignees: 'xxx' or 'xx1,xx2' assignees: 'xxx' or 'xx1,xx2'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| assignees | 指定人。当不填或者为空字符时,不操作 | string | ✖ | v1.1 | | assignees | 指定人。当不填或者为空字符时,不操作 | string | ✖ |
- `actions` 支持多个,需用逗号隔开。如:`add-assignees,add-labels` - `actions` 支持多个,需用逗号隔开。如:`add-assignees,add-labels`
- 其中的 `name` 可根据自行根据实际情况修改 - 其中的 `name` 可根据自行根据实际情况修改
- [on 参考](#github-docs) - [on 参考](#github-docs)
- `${{ github.event.issue.number }}` 表示当前 issue[更多参考](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events) - `${{ github.event.issue.number }}` 表示当前 issue[更多参考](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events)
- `assignees` 支持多个,需用逗号隔开。注意设置多个需使用v1.1以上版本 - `assignees` 支持多个,需用逗号隔开
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
@@ -114,7 +115,7 @@ jobs:
if: contains(github.event.issue.body, 'xxx') == false if: contains(github.event.issue.body, 'xxx') == false
steps: steps:
- name: Add labels - name: Add labels
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'add-labels' actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -122,14 +123,14 @@ jobs:
labels: 'bug' or 'bug1,bug2' labels: 'bug' or 'bug1,bug2'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| labels | 新增的 labels。当不填或者为空字符时不新增 | string | ✖ | v1.1 | | labels | 新增的 labels。当不填或者为空字符时不新增 | string | ✖ |
- `labels` 支持多个,需用逗号隔开。注意设置多个需使用v1.1以上版本 - `labels` 支持多个,需用逗号隔开
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
@@ -139,7 +140,7 @@ jobs:
```yml ```yml
- name: Close issue - name: Close issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'close-issue' actions: 'close-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -147,11 +148,11 @@ jobs:
body: 'This is auto closed.' body: 'This is auto closed.'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
@@ -172,7 +173,7 @@ jobs:
if: github.event.label.name == 'xxx' if: github.event.label.name == 'xxx'
steps: steps:
- name: Create comment - name: Create comment
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'create-comment' actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -184,19 +185,19 @@ jobs:
contents: '+1' or '+1,heart' contents: '+1' or '+1,heart'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| body | 新增评论的内容 | string | ✖ | v1 | | body | 新增评论的内容 | string | ✖ |
| contents | 为新增评论的增加 [reaction](#reactions-types) | string | ✖ | v1.1 | | contents | 为新增评论的增加 [reaction](#reactions-types) | string | ✖ |
- `body` 默认为:`Currently at ${owner}/${repo}. And this is default comment.` - `body` 默认为:`Currently at ${owner}/${repo}. And this is default comment.`
- 其中 `${owner}/${repo}` 表示当前仓库 - 其中 `${owner}/${repo}` 表示当前仓库
- 返回 `comment-id`,可用于之后操作。[用法参考](#outputs-使用) - 返回 `comment-id`,可用于之后操作。[用法参考](#outputs-使用)
- `${{ github.event.issue.user.login }}` 表示该 issue 的创建者 - `${{ github.event.issue.user.login }}` 表示该 issue 的创建者
- `contents` 支持多个,需用逗号隔开。注意设置多个需使用v1.1以上版本 - `contents` 支持多个,需用逗号隔开
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
@@ -216,7 +217,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Create issue - name: Create issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'create-issue' actions: 'create-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -227,15 +228,15 @@ jobs:
contents: '+1' contents: '+1'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| title | 新增 issue 的标题 | string | ✖ | v1 | | title | 新增 issue 的标题 | string | ✖ |
| body | 新增 issue 的内容 | string | ✖ | v1 | | body | 新增 issue 的内容 | string | ✖ |
| labels | 为新增 issue 添加 labels | string | ✖ | v1.1 | | labels | 为新增 issue 添加 labels | string | ✖ |
| assignees | 为新增 issue 添加 assignees | string | ✖ | v1.1 | | assignees | 为新增 issue 添加 assignees | string | ✖ |
| contents | 为新增 issue 增加 [reaction](#reactions-types) | string | ✖ | v1.1 | | contents | 为新增 issue 增加 [reaction](#reactions-types) | string | ✖ |
- `title` 默认为:`Default Title` - `title` 默认为:`Default Title`
- 返回 `issue-number`[用法参考](#outputs-使用) - 返回 `issue-number`[用法参考](#outputs-使用)
@@ -248,18 +249,18 @@ jobs:
```yml ```yml
- name: Delete comment - name: Delete comment
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'delete-comment' actions: 'delete-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
comment-id: xxx comment-id: xxx
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| comment-id | 指定的 comment | number | ✔ | v1 | | comment-id | 指定的 comment | number | ✔ |
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
@@ -280,51 +281,56 @@ jobs:
if: github.event.label.name == 'invalid' if: github.event.label.name == 'invalid'
steps: steps:
- name: Lock issue - name: Lock issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'lock-issue' actions: 'lock-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }} issue-number: ${{ github.event.issue.number }}
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
#### `mark-duplicate` #### `mark-duplicate`
快捷标记重复问题。 快捷标记重复问题,仅作用于 issue 新增评论
```yml ```yml
name: Issue Mark Duplicate name: Issue Mark Duplicate
on: on:
issue_comment: issue_comment:
types: [created, edited] types: [created]
jobs: jobs:
mark-duplicate: mark-duplicate:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: mark-duplicate - name: mark-duplicate
uses: actions-cool/issues-helper@v1.5 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'mark-duplicate' actions: 'mark-duplicate'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1.5 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1.5 | | token | [token 说明](#token) | string | ✔ |
| duplicate-command | 操作命令,默认为 `/d` | string | ✖ | v1.5 | | duplicate-command | 可设置简洁命令,如:`/d` | string | ✖ |
| duplicate-labels | 为该 issue 额外增加 labels | string | ✖ | v1.5 | | duplicate-labels | 为该 issue 额外增加 labels | string | ✖ |
| labels | 替换该 issue 的 labels | string | ✖ | v1.5 | | remove-labels | 设置可移除的 labels | string | ✖ |
| contents | 为该评论的增加 [reaction](#reactions-types) | string | ✖ | v1.5 | | labels | 替换该 issue 的 labels | string | ✖ |
| contents | 为该评论的增加 [reaction](#reactions-types) | string | ✖ |
| close-issue | 是否同时关闭该 issue | string | ✖ |
- `duplicate-command`:当设置简洁命令时,同时仍支持原有 `Duplicate of`
- `close-issue``true``'true'` 均可生效
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
@@ -334,18 +340,18 @@ jobs:
```yml ```yml
- name: Open issue - name: Open issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'open-issue' actions: 'open-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: xxx issue-number: xxx
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
@@ -355,7 +361,7 @@ jobs:
```yml ```yml
- name: Remove assignees - name: Remove assignees
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'remove-assignees' actions: 'remove-assignees'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -363,12 +369,12 @@ jobs:
assignees: 'xx' assignees: 'xx'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| assignees | 移除的指定人。当为空字符时,不进行移除 | string | ✔ | v1.1 | | assignees | 移除的指定人。当为空字符时,不进行移除 | string | ✔ |
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
@@ -378,7 +384,7 @@ jobs:
```yml ```yml
- name: Remove labels - name: Remove labels
uses: actions-cool/issues-helper@v1.2 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'remove-labels' actions: 'remove-labels'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -386,12 +392,12 @@ jobs:
labels: 'xx' labels: 'xx'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1.2 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1.2 | | token | [token 说明](#token) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1.2 | | issue-number | 指定的 issue | number | ✔ |
| labels | 移除的 labels。当为空字符时不进行移除 | string | ✔ | v1.2 | | labels | 移除的 labels。当为空字符时不进行移除 | string | ✔ |
- `labels` 支持多个,如 `x1,x2,x3`,只会移除 issue 已添加的 labels - `labels` 支持多个,如 `x1,x2,x3`,只会移除 issue 已添加的 labels
@@ -403,7 +409,7 @@ jobs:
```yml ```yml
- name: Set labels - name: Set labels
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'set-labels' actions: 'set-labels'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -411,12 +417,12 @@ jobs:
labels: 'xx' labels: 'xx'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| labels | labels 设置。当空字符时,会移除所有 | string | ✔ | v1.1 | | labels | labels 设置。当空字符时,会移除所有 | string | ✔ |
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
@@ -426,18 +432,18 @@ jobs:
```yml ```yml
- name: Unlock issue - name: Unlock issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'unlock-issue' actions: 'unlock-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }} issue-number: ${{ github.event.issue.number }}
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
@@ -459,7 +465,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Update comment - name: Update comment
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'update-comment' actions: 'update-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -467,14 +473,14 @@ jobs:
contents: 'eyes' contents: 'eyes'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| comment-id | 指定的 comment | number | ✔ | v1 | | comment-id | 指定的 comment | number | ✔ |
| body | 更新 comment 的内容 | string | ✖ | v1 | | body | 更新 comment 的内容 | string | ✖ |
| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ | v1 | | update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ |
| contents | 增加 [reaction](#reactions-types) | string | ✖ | v1.1 | | contents | 增加 [reaction](#reactions-types) | string | ✖ |
- `body` 不填时,会保持原有 - `body` 不填时,会保持原有
- `update-mode``append` 时,会进行附加操作。非 `append` 都会进行替换。仅对 `body` 生效 - `update-mode``append` 时,会进行附加操作。非 `append` 都会进行替换。仅对 `body` 生效
@@ -487,7 +493,7 @@ jobs:
```yml ```yml
- name: Update issue - name: Update issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'update-issue' actions: 'update-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -501,18 +507,18 @@ jobs:
contents: '+1' contents: '+1'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| state | 修改 issue 的状态,可选值 `open` `closed` | string | ✖ | v1 | | state | 修改 issue 的状态,可选值 `open` `closed` | string | ✖ |
| title | 修改 issue 的标题 | string | ✖ | v1 | | title | 修改 issue 的标题 | string | ✖ |
| body | 修改 issue 的内容 | string | ✖ | v1 | | body | 修改 issue 的内容 | string | ✖ |
| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ | v1 | | update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ |
| labels | 替换 issue 的 labels | string | ✖ | v1.1 | | labels | 替换 issue 的 labels | string | ✖ |
| assignees | 替换 issue 的 assignees | string | ✖ | v1.1 | | assignees | 替换 issue 的 assignees | string | ✖ |
| contents | 增加 [reaction](#reactions-types) | string | ✖ | v1.1 | | contents | 增加 [reaction](#reactions-types) | string | ✖ |
- `state` 默认为 `open` - `state` 默认为 `open`
- 当可选项不填时,会保持原有 - 当可选项不填时,会保持原有
@@ -535,7 +541,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: welcome - name: welcome
uses: actions-cool/issues-helper@v1.3 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'welcome' actions: 'welcome'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -545,14 +551,14 @@ jobs:
issue-contents: '+1, -1, eyes' issue-contents: '+1, -1, eyes'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1.3 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1.3 | | token | [token 说明](#token) | string | ✔ |
| body | 评论欢迎的内容,不填则不评论 | string | ✖ | v1.3 | | body | 评论欢迎的内容,不填则不评论 | string | ✖ |
| labels | 为该 issue 增加 labels | string | ✖ | v1.3 | | labels | 为该 issue 增加 labels | string | ✖ |
| assignees | 为该 issue 增加 assignees | string | ✖ | v1.3 | | assignees | 为该 issue 增加 assignees | string | ✖ |
| issue-contents | 为该 issue 增加 [reaction](#reactions-types) | string | ✖ | v1.3 | | issue-contents | 为该 issue 增加 [reaction](#reactions-types) | string | ✖ |
- 若这 4 个可选项都不填,则无操作 - 若这 4 个可选项都不填,则无操作
@@ -578,31 +584,31 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: check-inactive - name: check-inactive
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'check-inactive' actions: 'check-inactive'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
inactive-day: 30 inactive-day: 30
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | v1 | | body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ |
| contents | 为该评论增加 [reaction](#reactions-types) | string | ✖ | v1 | | contents | 为该评论增加 [reaction](#reactions-types) | string | ✖ |
| labels | 标签筛选 | string | ✖ | v1.1 | | labels | 标签筛选 | string | ✖ |
| issue-state | 状态筛选 | string | ✖ | v1 | | issue-state | 状态筛选 | string | ✖ |
| issue-assignee | 指定人筛选 | string | ✖ | v1 | | issue-assignee | 指定人筛选 | string | ✖ |
| issue-creator | 创建人筛选 | string | ✖ | v1 | | issue-creator | 创建人筛选 | string | ✖ |
| issue-mentioned | 提及人筛选 | string | ✖ | v1 | | issue-mentioned | 提及人筛选 | string | ✖ |
| body-includes | 包含内容筛选 | string | ✖ | v1 | | body-includes | 包含内容筛选 | string | ✖ |
| title-includes | 包含标题筛选 | string | ✖ | v1 | | title-includes | 包含标题筛选 | string | ✖ |
| inactive-day | 非活跃天数筛选 | number | ✖ | v1.4 | | inactive-day | 非活跃天数筛选 | number | ✖ |
| inactive-label | 新增标签名称 | string | ✖ | v1 | | inactive-label | 新增标签名称 | string | ✖ |
- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 - `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有
- `issue-state`:默认为 `all`。可选值 `open` `closed`,非这 2 项时,均为 `all` - `issue-state`:默认为 `open`。可选值 `all` `closed`,非这 2 项时,均为 `open`
- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues - `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues
- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 - `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有
- `inactive-label`:默认为 `inactive`,可自定义其他。当项目未包含该 label 时,会自动新建 - `inactive-label`:默认为 `inactive`,可自定义其他。当项目未包含该 label 时,会自动新建
@@ -627,7 +633,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: check-issue - name: check-issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'check-issue' actions: 'check-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -636,17 +642,17 @@ jobs:
title-includes: 'x1,x2/y1,y2' title-includes: 'x1,x2/y1,y2'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1.2 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1.2 | | token | [token 说明](#token) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1.2 | | issue-number | 指定的 issue | number | ✔ |
| assignee-includes | 是否包含指定人 | string | ✖ | v1.2 | | assignee-includes | 是否包含指定人 | string | ✖ |
| title-includes | 标题包含校验 | string | ✖ | v1.2 | | title-includes | 标题包含校验 | string | ✖ |
| body-includes | 内容包含校验 | string | ✖ | v1.2 | | body-includes | 内容包含校验 | string | ✖ |
- `title-includes` `body-includes` 支持格式 `x1,x2` 或者 `x1,x2/y1,y2`。只支持两个层级 - `title-includes` `body-includes` 支持格式 `x1,x2` 或者 `x1,x2/y1,y2`。只支持两个层级
- 返回 `check-result` - 返回 `check-result`,由于 yml 原因,判断条件为 `if: steps.xxid.outputs.check-result == 'true'`
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
@@ -666,7 +672,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: close-issues - name: close-issues
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'close-issues' actions: 'close-issues'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -674,19 +680,19 @@ jobs:
inactive-day: 7 inactive-day: 7
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | v1 | | body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ |
| contents | 为该评论增加 [reaction](#reactions-types) | string | ✖ | v1 | | contents | 为该评论增加 [reaction](#reactions-types) | string | ✖ |
| labels | 标签筛选 | string | ✖ | v1.1 | | labels | 标签筛选 | string | ✖ |
| issue-assignee | 指定人筛选 | string | ✖ | v1 | | issue-assignee | 指定人筛选 | string | ✖ |
| issue-creator | 创建人筛选 | string | ✖ | v1 | | issue-creator | 创建人筛选 | string | ✖ |
| issue-mentioned | 提及人筛选 | string | ✖ | v1 | | issue-mentioned | 提及人筛选 | string | ✖ |
| body-includes | 包含内容筛选 | string | ✖ | v1 | | body-includes | 包含内容筛选 | string | ✖ |
| title-includes | 包含标题筛选 | string | ✖ | v1 | | title-includes | 包含标题筛选 | string | ✖ |
| inactive-day | 非活跃天数筛选 | number | ✖ | v1.4 | | inactive-day | 非活跃天数筛选 | number | ✖ |
- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 - `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有
- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues - `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues
@@ -700,7 +706,7 @@ jobs:
```yml ```yml
- name: Find comments - name: Find comments
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'find-comments' actions: 'find-comments'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -709,14 +715,14 @@ jobs:
body-includes: 'this' body-includes: 'this'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| comment-auth | 评论创建者,不填时会查询所有 | string | ✖ | v1 | | comment-auth | 评论创建者,不填时会查询所有 | string | ✖ |
| body-includes | 评论内容包含过滤,不填时无校验 | string | ✖ | v1 | | body-includes | 评论内容包含过滤,不填时无校验 | string | ✖ |
| direction | 返回 `comments` 排序 | string | ✖ | v1 | | direction | 返回 `comments` 排序 | string | ✖ |
- 返回 `comments`,格式如下: - 返回 `comments`,格式如下:
@@ -748,7 +754,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: lock-issues - name: lock-issues
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'lock-issues' actions: 'lock-issues'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -756,28 +762,66 @@ jobs:
inactive-day: 128 inactive-day: 128
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ | v1 | | token | [token 说明](#token) | string | ✔ |
| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | v1 | | body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ |
| contents | 为该评论增加 [reaction](#reactions-types) | string | ✖ | v1 | | contents | 为该评论增加 [reaction](#reactions-types) | string | ✖ |
| labels | 标签筛选 | string | ✖ | v1.1 | | labels | 标签筛选 | string | ✖ |
| issue-state | 状态筛选 | string | ✖ | v1 | | issue-state | 状态筛选 | string | ✖ |
| issue-assignee | 指定人筛选 | string | ✖ | v1 | | issue-assignee | 指定人筛选 | string | ✖ |
| issue-creator | 创建人筛选 | string | ✖ | v1 | | issue-creator | 创建人筛选 | string | ✖ |
| issue-mentioned | 提及人筛选 | string | ✖ | v1 | | issue-mentioned | 提及人筛选 | string | ✖ |
| body-includes | 包含内容筛选 | string | ✖ | v1 | | body-includes | 包含内容筛选 | string | ✖ |
| title-includes | 包含标题筛选 | string | ✖ | v1 | | title-includes | 包含标题筛选 | string | ✖ |
| inactive-day | 非活跃天数筛选 | number | ✖ | v1.4 | | inactive-day | 非活跃天数筛选 | number | ✖ |
- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 - `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有
- `issue-state`:默认为 `all`。可选值 `open` `closed`,非这 2 项时,均为 `all` - `issue-state`:默认为 `open`。可选值 `all` `closed`,非这 2 项时,均为 `open`
- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues - `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues
- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 - `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有
⏫ [返回列表](#列-表) ⏫ [返回列表](#列-表)
#### `month-statistics`
每月 1 号 1 时,生成一个 issue 上月统计。
```
name: Issue Month Statistics
on:
schedule:
- cron: "0 1 1 * *"
jobs:
month-statistics:
runs-on: ubuntu-latest
steps:
- name: month-statistics
uses: actions-cool/issues-helper@v1.8
with:
actions: 'month-statistics'
token: ${{ secrets.GITHUB_TOKEN }}
count-lables: 'true'
```
| 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ |
| token | [token 说明](#token) | string | ✔ |
| labels | 为新增 issue 添加 labels | string | ✖ |
| assignees | 为新增 issue 添加 assignees | string | ✖ |
| count-lables | 新增 issue 是否统计 labels | string | ✖ |
| count-comments | 新增 issue 是否统计 comments | string | ✖ |
- 新增 `issue` 的标题默认为 `[当前仓库] Month Statistics: 年-月`
- `count-lables`:可设置 `'true'`,增加 labels 统计
- `count-comments`:可设置 `'true'`,增加 comments 统计
⏫ [返回列表](#列-表)
## 🌰 例 子 ## 🌰 例 子
灵活参考。 灵活参考。
@@ -799,7 +843,7 @@ jobs:
if: github.event.label.name == 'watch' if: github.event.label.name == 'watch'
steps: steps:
- name: find comments - name: find comments
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
id: fcid id: fcid
with: with:
actions: 'find-comments' actions: 'find-comments'
@@ -810,7 +854,7 @@ jobs:
- name: create comment - name: create comment
if: ${{ steps.fcid.outputs.comments.length == 0 }} if: ${{ steps.fcid.outputs.comments.length == 0 }}
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'create-comment' actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -819,7 +863,7 @@ jobs:
- name: update comment - name: update comment
if: ${{ steps.fcid.outputs.comments.length == 1 }} if: ${{ steps.fcid.outputs.comments.length == 1 }}
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'update-comment' actions: 'update-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -851,7 +895,7 @@ jobs:
```yml ```yml
- name: Create issue - name: Create issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
id: createissue id: createissue
with: with:
actions: 'create-issue' actions: 'create-issue'
@@ -927,7 +971,6 @@ x2 + y2
- v1 表示初始版本 - v1 表示初始版本
- 对 v1 版本的修复和新增会发布到 v1.1 版本 - 对 v1 版本的修复和新增会发布到 v1.1 版本
- 当发布的 v1.x 运行一定时间稳定后,发布进阶 v2 版本 - 当发布的 v1.x 运行一定时间稳定后,发布进阶 v2 版本
- API 中参数需使用其中最大及以上版本
- 版本选择 - 版本选择
- 建议采用最新 releases 版本。可在 [releases](https://github.com/actions-cool/issues-helper/releases) 看到 - 建议采用最新 releases 版本。可在 [releases](https://github.com/actions-cool/issues-helper/releases) 看到
@@ -952,50 +995,52 @@ x2 + y2
同时,如果你在使用过程中有什么疑问,也可以在 issue 或者 discussion 中进行提问和查询。 同时,如果你在使用过程中有什么疑问,也可以在 issue 或者 discussion 中进行提问和查询。
<table> <table>
<tr> <tr>
<td align="center"> <td align="center" width="180">
<a href="https://github.com/ant-design/ant-design"> <a href="https://github.com/ant-design/ant-design">
<img src="https://avatars1.githubusercontent.com/u/12101536?s=200&v=4" width="46" /> <img src="https://avatars1.githubusercontent.com/u/12101536?s=200&v=4" width="46" />
</a> <br />
</td> ant-design
<td align="center"> </a></td>
<a href="https://github.com/vueComponent/ant-design-vue"> <td align="center" width="180">
<img src="https://avatars2.githubusercontent.com/u/32120805?s=200&v=4" width="46" /> <a href="https://github.com/vueComponent/ant-design-vue">
</a> <img src="https://avatars1.githubusercontent.com/u/32120805?s=200&v=4" width="46" />
</td> <br />
<td align="center"> ant-design-vue
<a href="https://github.com/umijs/dumi"> </a></td>
<img src="https://avatars2.githubusercontent.com/u/33895495?s=200&v=4" width="46" /> <td align="center" width="180">
</a> <a href="https://github.com/umijs/dumi">
</td> <img src="https://avatars1.githubusercontent.com/u/33895495?s=200&v=4" width="46" />
<td align="center"> <br />
<a href="https://github.com/umijs/umi"> dumi
<img src="https://avatars2.githubusercontent.com/u/33895495?s=200&v=4" width="46" /> </a></td>
</a> <td align="center" width="180">
</td> <a href="https://github.com/mui-org/material-ui">
<td align="center"> <img src="https://avatars2.githubusercontent.com/u/33663932?s=200&v=4" width="46" />
<a href="https://github.com/AttoJS/vue-request"> <br />
<img src="https://raw.githubusercontent.com/AttoJS/art/master/vue-request-logo.png" width="46" /> material-ui
</a> </a></td>
</td> </tr><tr>
</tr> <td align="center" width="180">
<tr> <a href="https://github.com/lijinke666/react-music-player">
<td align="center" width="160"> <img src="https://github.com/lijinke666/react-music-player/blob/master/assetsImg/logo.png?raw=true" width="46" />
<strong>ant-design</strong> <br />
</td> react-music-player
<td align="center" width="160"> </a></td>
<strong>ant-design-vue</strong> <td align="center" width="180">
</td> <a href="https://github.com/umijs/umi">
<td align="center" width="160"> <img src="https://avatars1.githubusercontent.com/u/33895495?s=200&v=4" width="46" />
<strong>dumi</strong> <br />
</td> umi
<td align="center" width="160"> </a></td>
<strong>umi</strong> <td align="center" width="180">
</td> <a href="https://github.com/AttoJS/vue-request">
<td align="center" width="160"> <img src="https://raw.githubusercontent.com/AttoJS/art/master/vue-request-logo.png" width="46" />
<strong>vue-request</strong> <br />
</td> vue-request
</tr> </a></td>
<td align="center" width="180"></td>
</tr>
</table> </table>
## LICENSE ## LICENSE

42
USERS.js Normal file
View File

@@ -0,0 +1,42 @@
// **************************************************************************
// Add to end
const users = [
{
url: 'https://github.com/ant-design/ant-design',
logo: 'https://avatars1.githubusercontent.com/u/12101536?s=200&v=4'
},
{
url: 'https://github.com/vueComponent/ant-design-vue',
logo: 'https://avatars1.githubusercontent.com/u/32120805?s=200&v=4'
},
{
url: 'https://github.com/umijs/dumi',
logo: 'https://avatars1.githubusercontent.com/u/33895495?s=200&v=4'
},
{
url: 'https://github.com/umijs/umi',
logo: 'https://avatars1.githubusercontent.com/u/33895495?s=200&v=4'
},
{
url: 'https://github.com/AttoJS/vue-request',
logo: 'https://raw.githubusercontent.com/AttoJS/art/master/vue-request-logo.png'
},
{
url: 'https://github.com/mui-org/material-ui',
logo: 'https://avatars2.githubusercontent.com/u/33663932?s=200&v=4'
},
{
url: 'https://github.com/lijinke666/react-music-player',
logo: 'https://github.com/lijinke666/react-music-player/blob/master/assetsImg/logo.png?raw=true'
},
];
// **************************************************************************
module.exports = {
users
};
// **************************************************************************

View File

@@ -56,6 +56,14 @@ inputs:
description: 'For mark-duplicate' description: 'For mark-duplicate'
duplicate-labels: duplicate-labels:
description: 'For mark-duplicate add labels' description: 'For mark-duplicate add labels'
remove-labels:
description: 'For remove labels'
close-issue:
description: 'For mark-duplicate'
count-lables:
description: 'For month-statistics'
count-comments:
description: 'For month-statistics'
outputs: outputs:
issue-number: issue-number:
description: 'Create Issue Number' description: 'Create Issue Number'

437
dist/index.js vendored
View File

@@ -6029,51 +6029,60 @@ __webpack_require__(2437).config();
const core = __webpack_require__(2186); const core = __webpack_require__(2186);
const { Octokit } = __webpack_require__(5375); const { Octokit } = __webpack_require__(5375);
const {
doAddLabels,
doCreateComment,
doCloseIssue,
doLockIssue,
doCreateIssue,
} = __webpack_require__(9932);
const {
doQueryIssues,
getIssuesInMonth,
getCreatedMonth,
} = __webpack_require__(197);
const {
dealInput,
matchKeyword,
getPreMonth
} = __webpack_require__(6254);
// **************************************************************************
var dayjs = __webpack_require__(7401); var dayjs = __webpack_require__(7401);
var utc = __webpack_require__(4359); var utc = __webpack_require__(4359);
dayjs.extend(utc); dayjs.extend(utc);
var isSameOrBefore = __webpack_require__(9517);
dayjs.extend(isSameOrBefore);
const {
doAddLabels,
doCloseIssue,
doCreateComment,
doLockIssue
} = __webpack_require__(9932);
const { dealInput, matchKeyword } = __webpack_require__(6254);
// **************************************************************************
const token = core.getInput('token'); const token = core.getInput('token');
const octokit = new Octokit({ auth: `token ${token}` }); const octokit = new Octokit({ auth: `token ${token}` });
let direction = core.getInput("direction"); let direction = core.getInput("direction");
direction = direction === 'desc' ? 'desc' : 'asc'; direction = direction === 'desc' ? 'desc' : 'asc';
const commentAuth = core.getInput("comment-auth"); const commentAuth = core.getInput("comment-auth");
const bodyIncludes = core.getInput('body-includes'); const bodyIncludes = core.getInput('body-includes');
const titleIncludes = core.getInput('title-includes'); const titleIncludes = core.getInput('title-includes');
const assigneeIncludes = core.getInput('assignee-includes'); const assigneeIncludes = core.getInput('assignee-includes');
const issueCreator = core.getInput("issue-creator"); let issueState = core.getInput("issue-state") || 'open';
const issueAssignee = core.getInput('issue-assignee'); if (issueState != 'all' && issueState != 'closed') {
const issueMentioned = core.getInput('issue-mentioned'); issueState = 'open';
let issueState = core.getInput("issue-state") || 'all';
if (issueState != 'open' && issueState != 'closed') {
issueState = 'all';
} }
const inactiveDay = core.getInput("inactive-day");
const inactiveLabel = core.getInput("inactive-label") || 'inactive'; const inactiveLabel = core.getInput("inactive-label") || 'inactive';
// **************************************************************************
async function doCheckInactive (owner, repo, labels) { async function doCheckInactive (owner, repo, labels) {
const issues = await doQueryIssues(owner, repo, labels, issueState); const issues = await doQueryIssues(owner, repo, labels, issueState);
if (issues.length) { if (issues.length) {
for (let i = 0; i < issues.length; i++) { for (let i = 0; i < issues.length; i++) {
if (!JSON.stringify(issues[i].labels).includes(inactiveLabel)) { let arr = [];
issues[i].labels.forEach(it => {
arr.push(it.name);
});
if (!arr.includes(inactiveLabel)) {
await doAddLabels(owner, repo, issues[i].number, inactiveLabel); await doAddLabels(owner, repo, issues[i].number, inactiveLabel);
if (core.getInput("body")) { if (core.getInput("body")) {
await doCreateComment(owner, repo, issues[i].number, core.getInput("body")); await doCreateComment(owner, repo, issues[i].number, core.getInput("body"));
@@ -6192,66 +6201,135 @@ async function doLockIssues (owner, repo, labels) {
} }
}; };
async function doQueryIssues (owner, repo, labels, state, creator) { async function doMonthStatistics (owner, repo, labels, assignees) {
let params = { const countLables = core.getInput("count-lables");
const countComments = core.getInput("count-comments");
const thisMonth = dayjs.utc().month() + 1;
const year = thisMonth == 1 ? dayjs.utc().year() - 1 : dayjs.utc().year();
const month = getPreMonth(thisMonth);
const showMonth = month < 10 ? `0${month}` : month;
let issues = await getIssuesInMonth(
owner, owner,
repo, repo,
state, thisMonth
}; );
if (issues.length == 0) {
issueCreator ? params.creator = issueCreator : null; core.info(`Actions: [query-issues-${month}] empty!`);
issueAssignee ? params.assignee = issueAssignee : null; return false;
issueMentioned ? params.mentioned = issueMentioned : null;
if (labels) {
params.labels = labels;
} }
issues = issues.filter(i => {
if (creator) { return getCreatedMonth(i.created_at) == month
params.creator = creator; });
} let total = issues.length;
let totalIssues = [...issues];
const res = await octokit.issues.listForRepo(params); let openTotal = 0;
let issues = []; let openIssuesNumber = [];
let issueNumbers = []; let closeTotal = 0;
if (res.data.length) { let closeIssuesNumber = [];
res.data.forEach(iss => { let labelsTotals = [];
const a = bodyIncludes ? iss.body.includes(bodyIncludes) : true; const title = `[${owner}/${repo}] Month Statistics: ${year}-${showMonth}`;
const b = titleIncludes ? iss.title.includes(titleIncludes) : true; for (let i = 0; i < issues.length; i++) {
/** if (issues[i].state == 'closed') {
* Note: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. closeTotal += 1;
* For this reason, "Issues" endpoints may return both issues and pull requests in the response. closeIssuesNumber.push(issues[i].number);
* You can identify pull requests by the pull_request key. } else if (issues[i].state == 'open') {
*/ openTotal += 1;
if (a && b && iss.pull_request === undefined) { openIssuesNumber.push(issues[i].number);
if (inactiveDay) { }
let lastTime = dayjs.utc().subtract(Number(inactiveDay), 'day'); if (countLables && issues[i].labels) {
let updateTime = dayjs.utc(iss.updated_at); issues[i].labels.forEach(l => {
if (updateTime.isSameOrBefore(lastTime)) { if (l.name in labelsTotals) {
issues.push(iss); labelsTotals[l.name] += 1;
issueNumbers.push(iss.number);
}
} else { } else {
issues.push(iss); labelsTotals[l.name] = 1;
issueNumbers.push(iss.number);
} }
} })
}
}
let now = dayjs().utc().format('YYYY-MM-DD HH:mm:ss');
let body = `
- Created time: ${now}
- Time base: UTC +0
`;
let totalShow = `
### Count
| Total | Open | Closed |
| -- | -- | -- |
| ${total} | ${openTotal} | ${closeTotal} |
`;
body += totalShow;
if (countLables == 'true') {
let labelsArr = [];
for (var lab in labelsTotals) {
labelsArr.push({
labelName: lab,
number: labelsTotals[lab]
})
}
labelsArr.sort((a, b) => b.number - a.number);
let labelsTitle = `
### Labels statistics
<table>
<tr>
<th>Name</th>
<th>Number</th>
</tr>`
let labelsBody = '';
labelsArr.forEach(it => {
labelsBody += `<tr><td>${it.labelName}</td><td>${it.number}</td></tr>`
}) })
core.info(`Actions: [query-issues]: [${JSON.stringify(issueNumbers)}]!`); body = body + labelsTitle + labelsBody + `</table>
`;
} }
return issues; if (countComments == 'true') {
totalIssues.sort((a, b) => b.comments - a.comments);
const maxComments = totalIssues.slice(0, 3);
let commentTitle = `
### Most comments
<table>
<tr>
<th>#</th>
<th>Issue</th>
<th>Title</th>
<th>Number</th>
<th>State</th>
</tr>
`
let commentBody = '';
maxComments.forEach((it,ind) => {
commentBody += `<tr>
<td>${ind + 1}</td>
<td>${it.number}</td>
<td>${it.title}</td>
<td>${it.comments}</td>
<td>${it.state}</td></tr>`
})
body = body + commentTitle + commentBody + '</table>';
}
await doCreateIssue(owner, repo, title, body, labels, assignees);
}; };
// **************************************************************************
module.exports = { module.exports = {
doCheckInactive, doCheckInactive,
doCheckIssue, doCheckIssue,
doCloseIssues, doCloseIssues,
doFindComments, doFindComments,
doLockIssues, doLockIssues,
doMonthStatistics,
// tool
doQueryIssues,
}; };
@@ -6265,8 +6343,7 @@ const core = __webpack_require__(2186);
const github = __webpack_require__(5438); const github = __webpack_require__(5438);
const { Octokit } = __webpack_require__(5375); const { Octokit } = __webpack_require__(5375);
const { doQueryIssues } = __webpack_require__(9319); // **************************************************************************
const ALLREACTIONS = [ const ALLREACTIONS = [
"+1", "+1",
"-1", "-1",
@@ -6278,16 +6355,23 @@ const ALLREACTIONS = [
"eyes", "eyes",
]; ];
const { dealInput } = __webpack_require__(6254); const {
doQueryIssues
} = __webpack_require__(197);
const {
dealInput,
testDuplicate,
} = __webpack_require__(6254);
// **************************************************************************
const token = core.getInput('token'); const token = core.getInput('token');
const octokit = new Octokit({ auth: `token ${token}` }); const octokit = new Octokit({ auth: `token ${token}` });
const contents = core.getInput("contents");
const issueContents = core.getInput("issue-contents");
const context = github.context; const context = github.context;
const contents = core.getInput("contents");
// **************************************************************************
async function doAddAssignees (owner, repo, issueNumber, assignees) { async function doAddAssignees (owner, repo, issueNumber, assignees) {
await octokit.issues.addAssignees({ await octokit.issues.addAssignees({
owner, owner,
@@ -6407,22 +6491,41 @@ async function doMarkDuplicate (owner, repo, labels) {
core.info(`This actions only support on 'issue_comment'!`); core.info(`This actions only support on 'issue_comment'!`);
return false; return false;
} }
const duplicateCommand = core.getInput("duplicate-command") || '/d'; if (context.payload.action != 'created') {
core.info(`This actions only support on 'issue_comment' created!`);
return false;
}
const duplicateCommand = core.getInput("duplicate-command");
const duplicateLabels = core.getInput("duplicate-labels"); const duplicateLabels = core.getInput("duplicate-labels");
const removeLables = core.getInput("remove-labels");
const closeIssue = core.getInput("close-issue");
const commentId = context.payload.comment.id; const commentId = context.payload.comment.id;
const commentBody = context.payload.comment.body; const commentBody = context.payload.comment.body;
const issueNumber = context.payload.issue.number; const issueNumber = context.payload.issue.number;
if (commentBody.startsWith(duplicateCommand) && commentBody.split(' ')[0] == duplicateCommand) { const ifCommandInput = !!duplicateCommand;
const nextBody = commentBody.replace(duplicateCommand, 'Duplicate of');
await doUpdateComment(owner, repo, commentId, nextBody, 'replace', true); if ((ifCommandInput && commentBody.startsWith(duplicateCommand) && commentBody.split(' ')[0] == duplicateCommand) || testDuplicate(commentBody)) {
if (ifCommandInput) {
const nextBody = commentBody.replace(duplicateCommand, 'Duplicate of');
await doUpdateComment(owner, repo, commentId, nextBody, 'replace', true);
} else if (contents) {
await doCreateCommentContent(owner, repo, commentId, dealInput(contents));
}
if (duplicateLabels) { if (duplicateLabels) {
await doAddLabels(owner, repo, issueNumber, duplicateLabels); await doAddLabels(owner, repo, issueNumber, duplicateLabels);
} }
if (removeLables) {
await doRemoveLabels(owner, repo, issueNumber, removeLables);
}
if (labels) { if (labels) {
await doSetLabels(owner, repo, issueNumber, labels); await doSetLabels(owner, repo, issueNumber, labels);
} }
if (closeIssue == 'true') {
await doCloseIssue(owner, repo, issueNumber);
}
} else { } else {
core.info(`This comment body should start whith 'duplicate-command'`); core.info(`This comment body should start whith 'duplicate-command'`);
} }
@@ -6594,14 +6697,14 @@ async function doUpdateIssue (
async function doWelcome (owner, repo, assignees, labels, body) { async function doWelcome (owner, repo, assignees, labels, body) {
const context = github.context; const context = github.context;
const isIssue = !!context.payload.issue; const isIssue = !!context.payload.issue;
const issueContents = core.getInput("issue-contents");
if (!isIssue) { if (!isIssue) {
core.setFailed("The event that triggered this action must be a issue. Error!"); core.setFailed("The event that triggered this action must be a issue. Error!");
} else { } else {
const auth = context.payload.sender.login; const auth = context.payload.sender.login;
core.info(`Actions: [welcome: auth=][${auth}]`); core.info(`Actions: [welcome: auth=][${auth}]`);
const issueNumber = context.issue.number; const issueNumber = context.issue.number;
const creator = 'zoo-js-bot'; const issues = await doQueryIssues(owner, repo, false, 'all', auth);
const issues = await doQueryIssues(owner, repo, false, 'all', creator);
if (issues.length == 0 || (issues.length == 1 && issues[0].number == issueNumber)) { if (issues.length == 0 || (issues.length == 1 && issues[0].number == issueNumber)) {
if (core.getInput("body")) { if (core.getInput("body")) {
await doCreateComment(owner, repo, issueNumber, body); await doCreateComment(owner, repo, issueNumber, body);
@@ -6626,7 +6729,7 @@ async function doWelcome (owner, repo, assignees, labels, body) {
} }
}; };
// tool // **************************************************************************
function testContent(con) { function testContent(con) {
if (ALLREACTIONS.includes(con)) { if (ALLREACTIONS.includes(con)) {
return true; return true;
@@ -6636,7 +6739,7 @@ function testContent(con) {
} }
}; };
// exports // **************************************************************************
module.exports = { module.exports = {
doAddAssignees, doAddAssignees,
doAddLabels, doAddLabels,
@@ -6667,14 +6770,13 @@ module.exports = {
const core = __webpack_require__(2186); const core = __webpack_require__(2186);
const github = __webpack_require__(5438); const github = __webpack_require__(5438);
// **************************************************************************
const { const {
doAddAssignees, doAddAssignees,
doAddLabels, doAddLabels,
doCloseIssue, doCloseIssue,
doCreateComment, doCreateComment,
doCreateCommentContent,
doCreateIssue, doCreateIssue,
doCreateIssueContent,
doDeleteComment, doDeleteComment,
doMarkDuplicate, doMarkDuplicate,
doLockIssue, doLockIssue,
@@ -6694,8 +6796,10 @@ const {
doCloseIssues, doCloseIssues,
doFindComments, doFindComments,
doLockIssues, doLockIssues,
doMonthStatistics,
} = __webpack_require__(9319); } = __webpack_require__(9319);
// **************************************************************************
const ALLACTIONS = [ const ALLACTIONS = [
// base // base
'add-assignees', 'add-assignees',
@@ -6721,8 +6825,10 @@ const ALLACTIONS = [
'close-issues', 'close-issues',
'find-comments', 'find-comments',
'lock-issues', 'lock-issues',
'month-statistics',
]; ];
// **************************************************************************
async function main() { async function main() {
try { try {
const owner = github.context.repo.owner; const owner = github.context.repo.owner;
@@ -6873,6 +6979,14 @@ async function main() {
labels labels
); );
break; break;
case 'month-statistics':
await doMonthStatistics(
owner,
repo,
labels,
assignees
);
break;
// default // default
default: default:
break; break;
@@ -6884,15 +6998,151 @@ async function main() {
} }
} }
// **************************************************************************
main(); main();
/***/ }),
/***/ 197:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
__webpack_require__(2437).config();
const core = __webpack_require__(2186);
const { Octokit } = __webpack_require__(5375);
const {
getPreMonth
} = __webpack_require__(6254);
// **************************************************************************
var dayjs = __webpack_require__(7401);
var utc = __webpack_require__(4359);
dayjs.extend(utc);
var isSameOrBefore = __webpack_require__(9517);
dayjs.extend(isSameOrBefore);
// **************************************************************************
const token = core.getInput('token');
const octokit = new Octokit({ auth: `token ${token}` });
const perPage = 100;
const issueCreator = core.getInput("issue-creator");
const issueAssignee = core.getInput('issue-assignee');
const issueMentioned = core.getInput('issue-mentioned');
const bodyIncludes = core.getInput('body-includes');
const titleIncludes = core.getInput('title-includes');
const inactiveDay = core.getInput("inactive-day");
// **************************************************************************
async function doQueryIssues (owner, repo, labels, state, creator) {
let params = {
owner,
repo,
state,
};
issueCreator ? params.creator = issueCreator : null;
issueAssignee ? params.assignee = issueAssignee : null;
issueMentioned ? params.mentioned = issueMentioned : null;
if (labels) {
params.labels = labels;
}
if (creator) {
params.creator = creator;
}
const res = await getIssues(params);
let issues = [];
let issueNumbers = [];
if (res.length) {
res.forEach(iss => {
const a = bodyIncludes ? iss.body.includes(bodyIncludes) : true;
const b = titleIncludes ? iss.title.includes(titleIncludes) : true;
/**
* Note: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request.
* For this reason, "Issues" endpoints may return both issues and pull requests in the response.
* You can identify pull requests by the pull_request key.
*/
if (a && b && iss.pull_request === undefined) {
if (inactiveDay) {
let lastTime = dayjs.utc().subtract(Number(inactiveDay), 'day');
let updateTime = dayjs.utc(iss.updated_at);
if (updateTime.isSameOrBefore(lastTime)) {
issues.push(iss);
issueNumbers.push(iss.number);
}
} else {
issues.push(iss);
issueNumbers.push(iss.number);
}
}
})
core.info(`Actions: [query-issues]: [${JSON.stringify(issueNumbers)}]!`);
}
return issues;
};
async function getIssues (params, page = 1) {
let { data: issues } = await octokit.issues.listForRepo({
...params,
per_page: perPage,
page
});
if (issues.length >= perPage) {
issues = issues.concat(await getIssues(params, page + 1));
}
return issues;
};
async function getIssuesInMonth (owner, repo, thisMonth, page = 1) {
const month = getPreMonth(thisMonth);
let { data: issues } = await octokit.issues.listForRepo({
owner,
repo,
state: 'all',
per_page: perPage,
page
});
issues = issues.filter(i => {
return i.pull_request === undefined
});
if (issues.length && getCreatedMonth(issues[issues.length - 1].created_at) >= month) {
issues = issues.concat(await getIssuesInMonth(owner, repo, thisMonth, page + 1));
}
return issues;
};
// **************************************************************************
function getCreatedMonth (d) {
return dayjs(d).utc().month() + 1;
};
// **************************************************************************
module.exports = {
doQueryIssues,
getIssues,
getIssuesInMonth,
getCreatedMonth,
};
/***/ }), /***/ }),
/***/ 6254: /***/ 6254:
/***/ ((module) => { /***/ ((module) => {
function dealInput (para) { function dealInput (para) {
/**
* in 'x1,x2,x3'
* out ['x1','x2','x3']
*/
let arr = []; let arr = [];
if (para) { if (para) {
const paraArr = para.split(','); const paraArr = para.split(',');
@@ -6905,13 +7155,32 @@ function dealInput (para) {
return arr; return arr;
}; };
function matchKeyword(content, keywords) { function matchKeyword (content, keywords) {
return keywords.find(item => content.toLowerCase().includes(item)); return keywords.find(item => content.toLowerCase().includes(item));
}; };
function testDuplicate(body) {
if (!body || !body.startsWith('Duplicate of')) {
return false
}
let arr = body.split(' ');
if (arr[0] == 'Duplicate' && arr[1] == 'of') {
return true;
} else {
return false;
}
};
function getPreMonth (m) {
return m == 1 ? 12 : m -1;
};
module.exports = { module.exports = {
dealInput, dealInput,
getPreMonth,
matchKeyword, matchKeyword,
testDuplicate,
}; };

View File

@@ -22,28 +22,28 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: check-inactive - name: check-inactive
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'check-inactive' actions: 'check-inactive'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
inactive-day: 30 inactive-day: 30
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | v1 | | 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 | ✖ | v1 | | contents | Add [reaction](/en-US/guide/ref#-reactions-type) for this comment | string | ✖ |
| labels | Labels filtering | string | ✖ | v1.1 | | labels | Labels filtering | string | ✖ |
| issue-state | State filtering | string | ✖ | v1 | | issue-state | State filtering | string | ✖ |
| issue-assignee | Assignee filtering | string | ✖ | v1 | | issue-assignee | Assignee filtering | string | ✖ |
| issue-creator | Creator filtering | string | ✖ | v1 | | issue-creator | Creator filtering | string | ✖ |
| issue-mentioned | Mentioned filtering | string | ✖ | v1 | | issue-mentioned | Mentioned filtering | string | ✖ |
| body-includes | Body filtering | string | ✖ | v1 | | body-includes | Body filtering | string | ✖ |
| title-includes | Title filtering | string | ✖ | v1 | | title-includes | Title filtering | string | ✖ |
| inactive-day | Inactive days filtering | number | ✖ | v1.4 | | inactive-day | Inactive days filtering | number | ✖ |
| inactive-label | The label name adding | string | ✖ | v1 | | inactive-label | The label name adding | string | ✖ |
- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all - `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-state`: The default is `all`. Optional value `open` `closed`, when these 2 items are not, both are `all`
@@ -73,7 +73,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: check-issue - name: check-issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'check-issue' actions: 'check-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -82,17 +82,17 @@ jobs:
title-includes: 'x1,x2/y1,y2' title-includes: 'x1,x2/y1,y2'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1.2 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1.2 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1.2 | | issue-number | The number of issue | number | ✔ |
| assignee-includes | Assignees contains check | string | ✖ | v1.2 | | assignee-includes | Assignees contains check | string | ✖ |
| title-includes | Title contains check | string | ✖ | v1.2 | | title-includes | Title contains check | string | ✖ |
| body-includes | Body contains check | string | ✖ | v1.2 | | body-includes | Body contains check | string | ✖ |
- `title-includes` `body-includes` supports the format `x1,x2` or `x1,x2/y1,y2`. Only supports two levels - `title-includes` `body-includes` supports the format `x1,x2` or `x1,x2/y1,y2`. Only supports two levels
- Return `check-result` - Return `check-result`, due to yml reasons, the judgment condition is `if: steps.xxid.outputs.check-result =='true'`
## `close-issues` ## `close-issues`
@@ -110,7 +110,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: close-issues - name: close-issues
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'close-issues' actions: 'close-issues'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -118,19 +118,19 @@ jobs:
inactive-day: 7 inactive-day: 7
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | v1 | | 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 | ✖ | v1 | | contents | Add [reaction](/en-US/guide/ref#-reactions-type) for this comment | string | ✖ |
| labels | Labels filtering | string | ✖ | v1.1 | | labels | Labels filtering | string | ✖ |
| issue-assignee | Assignee filtering | string | ✖ | v1 | | issue-assignee | Assignee filtering | string | ✖ |
| issue-creator | Creator filtering | string | ✖ | v1 | | issue-creator | Creator filtering | string | ✖ |
| issue-mentioned | Mentioned filtering | string | ✖ | v1 | | issue-mentioned | Mentioned filtering | string | ✖ |
| body-includes | Body filtering | string | ✖ | v1 | | body-includes | Body filtering | string | ✖ |
| title-includes | Title filtering | string | ✖ | v1 | | title-includes | Title filtering | string | ✖ |
| inactive-day | Inactive days filtering | number | ✖ | v1.4 | | inactive-day | Inactive days filtering | number | ✖ |
- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all - `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 - `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
@@ -142,7 +142,7 @@ Find the current warehouse issue No. 1, the creator is k and the content contain
```yml ```yml
- name: Find comments - name: Find comments
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'find-comments' actions: 'find-comments'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -151,14 +151,14 @@ Find the current warehouse issue No. 1, the creator is k and the content contain
body-includes: 'this' body-includes: 'this'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| comment-auth | Comment creator, all will be queried if not filled | string | ✖ | v1 | | comment-auth | Comment creator, all will be queried if not filled | string | ✖ |
| body-includes | Comment content includes filtering, no verification if not filled | string | ✖ | v1 | | body-includes | Comment content includes filtering, no verification if not filled | string | ✖ |
| direction | Return `comments` sort | string | ✖ | v1 | | direction | Return `comments` sort | string | ✖ |
- Return `comments` in the following format: - Return `comments` in the following format:
@@ -188,7 +188,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: lock-issues - name: lock-issues
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'lock-issues' actions: 'lock-issues'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -196,22 +196,62 @@ jobs:
inactive-day: 128 inactive-day: 128
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| body | When operating an issue, you can comment. Do not comment when not typing | string | ✖ | v1 | | 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 | ✖ | v1 | | contents | Add [reaction](/en-US/guide/ref#-reactions-type) for this comment | string | ✖ |
| labels | Labels filtering | string | ✖ | v1.1 | | labels | Labels filtering | string | ✖ |
| issue-state | State filtering | string | ✖ | v1 | | issue-state | State filtering | string | ✖ |
| issue-assignee | Assignee filtering | string | ✖ | v1 | | issue-assignee | Assignee filtering | string | ✖ |
| issue-creator | Creator filtering | string | ✖ | v1 | | issue-creator | Creator filtering | string | ✖ |
| issue-mentioned | Mentioned filtering | string | ✖ | v1 | | issue-mentioned | Mentioned filtering | string | ✖ |
| body-includes | Body filtering | string | ✖ | v1 | | body-includes | Body filtering | string | ✖ |
| title-includes | Title filtering | string | ✖ | v1 | | title-includes | Title filtering | string | ✖ |
| inactive-day | Inactive days filtering | number | ✖ | v1.4 | | inactive-day | Inactive days filtering | number | ✖ |
- `labels`: When there are multiple, the query will have multiple at the same time. If not entered, all - `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-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 - `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-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
## `month-statistics`
At 1 o'clock on the 1st of each month, an issue is generated for the statistics of the previous month.
```
name: Issue Month Statistics
on:
schedule:
- cron: "0 1 1 * *"
jobs:
month-statistics:
runs-on: ubuntu-latest
steps:
- name: month-statistics
uses: actions-cool/issues-helper@v1.8
with:
actions: 'month-statistics'
token: ${{ secrets.GITHUB_TOKEN }}
count-lables: 'true'
```
| Param | Desc | Type | Required |
| -- | -- | -- | -- |
| actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| labels | The labels for the new issue | string | ✖ |
| assignees | The assignees for the new issue | string | ✖ |
| count-lables | Whether the new issue count labels | string | ✖ |
| count-comments | Whether the new issue count comments | string | ✖ |
- The new issue title defaults to `[Current repo] Month Statistics: Year-Month`
- `count-lables`: You can set `'true'` to add labels statistics
- `count-comments`: You can set `'true'` to add comments statistics
As follows:
![](../public/month.png)

View File

@@ -22,28 +22,28 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: check-inactive - name: check-inactive
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'check-inactive' actions: 'check-inactive'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
inactive-day: 30 inactive-day: 30
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | v1 | | body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ |
| contents | 为该评论增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ | v1 | | contents | 为该评论增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ |
| labels | 标签筛选 | string | ✖ | v1.1 | | labels | 标签筛选 | string | ✖ |
| issue-state | 状态筛选 | string | ✖ | v1 | | issue-state | 状态筛选 | string | ✖ |
| issue-assignee | 指定人筛选 | string | ✖ | v1 | | issue-assignee | 指定人筛选 | string | ✖ |
| issue-creator | 创建人筛选 | string | ✖ | v1 | | issue-creator | 创建人筛选 | string | ✖ |
| issue-mentioned | 提及人筛选 | string | ✖ | v1 | | issue-mentioned | 提及人筛选 | string | ✖ |
| body-includes | 包含内容筛选 | string | ✖ | v1 | | body-includes | 包含内容筛选 | string | ✖ |
| title-includes | 包含标题筛选 | string | ✖ | v1 | | title-includes | 包含标题筛选 | string | ✖ |
| inactive-day | 非活跃天数筛选 | number | ✖ | v1.4 | | inactive-day | 非活跃天数筛选 | number | ✖ |
| inactive-label | 新增标签名称 | string | ✖ | v1 | | inactive-label | 新增标签名称 | string | ✖ |
- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 - `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有
- `issue-state`:默认为 `all`。可选值 `open` `closed`,非这 2 项时,均为 `all` - `issue-state`:默认为 `all`。可选值 `open` `closed`,非这 2 项时,均为 `all`
@@ -69,7 +69,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: check-issue - name: check-issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'check-issue' actions: 'check-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -78,17 +78,17 @@ jobs:
title-includes: 'x1,x2/y1,y2' title-includes: 'x1,x2/y1,y2'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1.2 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1.2 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1.2 | | issue-number | 指定的 issue | number | ✔ |
| assignee-includes | 是否包含指定人 | string | ✖ | v1.2 | | assignee-includes | 是否包含指定人 | string | ✖ |
| title-includes | 标题包含校验 | string | ✖ | v1.2 | | title-includes | 标题包含校验 | string | ✖ |
| body-includes | 内容包含校验 | string | ✖ | v1.2 | | body-includes | 内容包含校验 | string | ✖ |
- `title-includes` `body-includes` 支持格式 `x1,x2` 或者 `x1,x2/y1,y2`。只支持两个层级 - `title-includes` `body-includes` 支持格式 `x1,x2` 或者 `x1,x2/y1,y2`。只支持两个层级
- 返回 `check-result` - 返回 `check-result`,由于 yml 原因,判断条件为 `if: steps.xxid.outputs.check-result == 'true'`
## `close-issues` ## `close-issues`
@@ -106,7 +106,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: close-issues - name: close-issues
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'close-issues' actions: 'close-issues'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -114,19 +114,19 @@ jobs:
inactive-day: 7 inactive-day: 7
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | v1 | | body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ |
| contents | 为该评论增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ | v1 | | contents | 为该评论增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ |
| labels | 标签筛选 | string | ✖ | v1.1 | | labels | 标签筛选 | string | ✖ |
| issue-assignee | 指定人筛选 | string | ✖ | v1 | | issue-assignee | 指定人筛选 | string | ✖ |
| issue-creator | 创建人筛选 | string | ✖ | v1 | | issue-creator | 创建人筛选 | string | ✖ |
| issue-mentioned | 提及人筛选 | string | ✖ | v1 | | issue-mentioned | 提及人筛选 | string | ✖ |
| body-includes | 包含内容筛选 | string | ✖ | v1 | | body-includes | 包含内容筛选 | string | ✖ |
| title-includes | 包含标题筛选 | string | ✖ | v1 | | title-includes | 包含标题筛选 | string | ✖ |
| inactive-day | 非活跃天数筛选 | number | ✖ | v1.4 | | inactive-day | 非活跃天数筛选 | number | ✖ |
- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 - `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有
- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues - `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues
@@ -138,7 +138,7 @@ jobs:
```yml ```yml
- name: Find comments - name: Find comments
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'find-comments' actions: 'find-comments'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -147,14 +147,14 @@ jobs:
body-includes: 'this' body-includes: 'this'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| comment-auth | 评论创建者,不填时会查询所有 | string | ✖ | v1 | | comment-auth | 评论创建者,不填时会查询所有 | string | ✖ |
| body-includes | 评论内容包含过滤,不填时无校验 | string | ✖ | v1 | | body-includes | 评论内容包含过滤,不填时无校验 | string | ✖ |
| direction | 返回 `comments` 排序 | string | ✖ | v1 | | direction | 返回 `comments` 排序 | string | ✖ |
- 返回 `comments`,格式如下: - 返回 `comments`,格式如下:
@@ -184,7 +184,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: lock-issues - name: lock-issues
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'lock-issues' actions: 'lock-issues'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -192,22 +192,62 @@ jobs:
inactive-day: 128 inactive-day: 128
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ | v1 | | body | 操作 issue 时,可进行评论。不填时,不评论 | string | ✖ |
| contents | 为该评论增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ | v1 | | contents | 为该评论增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ |
| labels | 标签筛选 | string | ✖ | v1.1 | | labels | 标签筛选 | string | ✖ |
| issue-state | 状态筛选 | string | ✖ | v1 | | issue-state | 状态筛选 | string | ✖ |
| issue-assignee | 指定人筛选 | string | ✖ | v1 | | issue-assignee | 指定人筛选 | string | ✖ |
| issue-creator | 创建人筛选 | string | ✖ | v1 | | issue-creator | 创建人筛选 | string | ✖ |
| issue-mentioned | 提及人筛选 | string | ✖ | v1 | | issue-mentioned | 提及人筛选 | string | ✖ |
| body-includes | 包含内容筛选 | string | ✖ | v1 | | body-includes | 包含内容筛选 | string | ✖ |
| title-includes | 包含标题筛选 | string | ✖ | v1 | | title-includes | 包含标题筛选 | string | ✖ |
| inactive-day | 非活跃天数筛选 | number | ✖ | v1.4 | | inactive-day | 非活跃天数筛选 | number | ✖ |
- `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有 - `labels`:为多个时,会查询同时拥有多个。不填时,会查询所有
- `issue-state`:默认为 `all`。可选值 `open` `closed`,非这 2 项时,均为 `all` - `issue-state`:默认为 `all`。可选值 `open` `closed`,非这 2 项时,均为 `all`
- `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues - `issue-assignee`:不支持多人。不填或输入 * 时,查询所有。输入 `none` 会查询未添加指定人的 issues
- `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有 - `inactive-day`:当输入时,会筛选 issue 更新时间早于当前时间减去非活跃天数。不填时,会查询所有
## `month-statistics`
每月 1 号 1 时,生成一个 issue 上月统计。
```
name: Issue Month Statistics
on:
schedule:
- cron: "0 1 1 * *"
jobs:
month-statistics:
runs-on: ubuntu-latest
steps:
- name: month-statistics
uses: actions-cool/issues-helper@v1.8
with:
actions: 'month-statistics'
token: ${{ secrets.GITHUB_TOKEN }}
count-lables: 'true'
```
| 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| labels | 为新增 issue 添加 labels | string | ✖ |
| assignees | 为新增 issue 添加 assignees | string | ✖ |
| count-lables | 新增 issue 是否统计 labels | string | ✖ |
| count-comments | 新增 issue 是否统计 comments | string | ✖ |
- 新增 `issue` 的标题默认为 `[当前仓库] Month Statistics: 年-月`
- `count-lables`:可设置 `'true'`,增加 labels 统计
- `count-comments`:可设置 `'true'`,增加 comments 统计
如下所示:
![](../public/month.png)

View File

@@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Add assigness - name: Add assigness
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'add-assignees' actions: 'add-assignees'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -30,18 +30,18 @@ jobs:
assignees: 'xxx' or 'xx1,xx2' assignees: 'xxx' or 'xx1,xx2'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| assignees | Designated person. No operation when no input or empty character | string | ✖ | v1.1 | | assignees | Designated person. No operation when no input or empty character | string | ✖ |
- `actions` support multiple and separated by comma. Like: `add-assignees,add-labels` - `actions` support multiple and separated by comma. Like: `add-assignees,add-labels`
- The `name` can be modified according to the actual situation - The `name` can be modified according to the actual situation
- [Reference to on](/en-US/guide/ref#-github-docs) - [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) - `${{ 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 - `assignees` support multiple and separated by comma
## `add-labels` ## `add-labels`
@@ -60,7 +60,7 @@ jobs:
if: contains(github.event.issue.body, 'xxx') == false if: contains(github.event.issue.body, 'xxx') == false
steps: steps:
- name: Add labels - name: Add labels
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'add-labels' actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -68,14 +68,14 @@ jobs:
labels: 'bug' or 'xx1,xx2' labels: 'bug' or 'xx1,xx2'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| labels | New labels. When it is not filled in or is empty character, do not add | string | ✖ | v1.1 | | labels | New labels. When it is not filled in or is empty character, do not add | string | ✖ |
- `labels` support multiple and separated by comma. Pay attention to multiple settings, you need to use the version above v1.1 - `labels` support multiple and separated by comma
## `close-issue` ## `close-issue`
@@ -83,7 +83,7 @@ Close the specified issue.
```yml ```yml
- name: Close issue - name: Close issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'close-issue' actions: 'close-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -91,11 +91,11 @@ Close the specified issue.
body: 'This is auto closed.' body: 'This is auto closed.'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
## `create-comment` ## `create-comment`
@@ -114,7 +114,7 @@ jobs:
if: github.event.label.name == 'xxx' if: github.event.label.name == 'xxx'
steps: steps:
- name: Create comment - name: Create comment
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'create-comment' actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -126,19 +126,19 @@ jobs:
contents: '+1' or '+1,heart' contents: '+1' or '+1,heart'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| body | Add comment content | string | ✖ | v1 | | body | Add comment content | string | ✖ |
| contents | Add [reaction](/en-US/guide/ref#-reactions-type) | string | ✖ | v1.1 | | contents | Add [reaction](/en-US/guide/ref#-reactions-type) | string | ✖ |
- `body` default is `Currently at ${owner}/${repo}. And this is default comment.` - `body` default is `Currently at ${owner}/${repo}. And this is default comment.`
- Where `${owner}/${repo}` means the current repo - Where `${owner}/${repo}` means the current repo
- Return `comment-id`, which can be used for subsequent operations. [Usage reference](/en-US/guide/ref#-outputs-use) - 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 - `${{ 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 - `contents` support multiple and separated by comma
## `create-issue` ## `create-issue`
@@ -156,7 +156,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Create issue - name: Create issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'create-issue' actions: 'create-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -167,15 +167,15 @@ jobs:
contents: '+1' contents: '+1'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| title | The title of the new issue | string | ✖ | v1 | | title | The title of the new issue | string | ✖ |
| body | The body of the new issue | string | ✖ | v1 | | body | The body of the new issue | string | ✖ |
| labels | The labels for the new issue | string | ✖ | v1.1 | | labels | The labels for the new issue | string | ✖ |
| assignees | The assignees for the new issue | string | ✖ | v1.1 | | assignees | The assignees for the new issue | string | ✖ |
| contents | Add [reaction](/en-US/guide/ref#-reactions-type) | string | ✖ | v1.1 | | contents | Add [reaction](/en-US/guide/ref#-reactions-type) | string | ✖ |
- `title` default is `Default Title` - `title` default is `Default Title`
- Return `issue-number`. [Usage reference](/en-US/guide/ref#-outputs-use) - Return `issue-number`. [Usage reference](/en-US/guide/ref#-outputs-use)
@@ -186,18 +186,18 @@ According to [`comment-id`](/en-US/guide/ref#-comment-id) delete the specified c
```yml ```yml
- name: Delete comment - name: Delete comment
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'delete-comment' actions: 'delete-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
comment-id: xxx comment-id: xxx
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| comment-id | The comment ID | number | ✔ | v1 | | comment-id | The comment ID | number | ✔ |
## `lock-issue` ## `lock-issue`
@@ -216,49 +216,60 @@ jobs:
if: github.event.label.name == 'invalid' if: github.event.label.name == 'invalid'
steps: steps:
- name: Lock issue - name: Lock issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'lock-issue' actions: 'lock-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }} issue-number: ${{ github.event.issue.number }}
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
## `mark-duplicate` ## `mark-duplicate`
Quickly mark duplicate issue. Quickly mark duplicate questions, only for issue new comments.
```yml ```yml
name: Issue Mark Duplicate name: Issue Mark Duplicate
on: on:
issue_comment: issue_comment:
types: [created, edited] types: [created]
jobs: jobs:
mark-duplicate: mark-duplicate:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: mark-duplicate - name: mark-duplicate
uses: actions-cool/issues-helper@v1.5 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'mark-duplicate' actions: 'mark-duplicate'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1.5 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1.5 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| duplicate-command | Operation command, default is `/d` | string | ✖ | v1.5 | | duplicate-command | Simple commands can be set, such as: `/d` | string | ✖ |
| duplicate-labels | Add additional labels to this issue | string | ✖ | v1.5 | | duplicate-labels | Add additional labels to this issue | string | ✖ |
| labels | Replace the labels of the issue | string | ✖ | v1.5 | | remove-labels | Set removable labels | string | ✖ |
| contents | Add [reaction](/en-US/guide/ref#-reactions-type) for this comment | string | ✖ | v1.5 | | labels | Replace the labels of the issue | string | ✖ |
| contents | Add [reaction](/en-US/guide/ref#-reactions-type) for this comment | string | ✖ |
| close-issue | Whether to close the issue at the same time | string | ✖ |
- `duplicate-command`: When setting concise commands, while still supporting the original `Duplicate of`
- `close-issue`: Both `true` or `'true'` can take effect
<Alert>
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.
</Alert>
![](../public/duplicate.png)
## `open-issue` ## `open-issue`
@@ -266,18 +277,18 @@ Open the specified issue.
```yml ```yml
- name: Open issue - name: Open issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'open-issue' actions: 'open-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: xxx issue-number: xxx
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
## `remove-assignees` ## `remove-assignees`
@@ -285,7 +296,7 @@ Remove the person designated by issue.
```yml ```yml
- name: Remove assignees - name: Remove assignees
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'remove-assignees' actions: 'remove-assignees'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -293,12 +304,12 @@ Remove the person designated by issue.
assignees: 'xx' assignees: 'xx'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| assignees | Designated person removed. When it is an empty character, do not remove | string | ✔ | v1.1 | | assignees | Designated person removed. When it is an empty character, do not remove | string | ✔ |
## `remove-labels` ## `remove-labels`
@@ -306,7 +317,7 @@ Remove the specified labels.
```yml ```yml
- name: Remove labels - name: Remove labels
uses: actions-cool/issues-helper@v1.2 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'remove-labels' actions: 'remove-labels'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -314,12 +325,12 @@ Remove the specified labels.
labels: 'xx' labels: 'xx'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1.2 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1.2 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1.2 | | issue-number | The number of issue | number | ✔ |
| labels | The removed labels. When it is a blank character, do not remove | string | ✔ | v1.2 | | 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 - `labels` supports multiple, such as `x1,x2,x3`, only the labels added by the issue will be removed
@@ -329,7 +340,7 @@ Replace the labels of issue.
```yml ```yml
- name: Set labels - name: Set labels
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'set-labels' actions: 'set-labels'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -337,12 +348,12 @@ Replace the labels of issue.
labels: 'xx' labels: 'xx'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| labels | labels set. When empty characters, will remove all | string | ✔ | v1.1 | | labels | labels set. When empty characters, will remove all | string | ✔ |
## `unlock-issue` ## `unlock-issue`
@@ -350,18 +361,18 @@ Unlock the specified issue.
```yml ```yml
- name: Unlock issue - name: Unlock issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'unlock-issue' actions: 'unlock-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }} issue-number: ${{ github.event.issue.number }}
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
## `update-comment` ## `update-comment`
@@ -381,7 +392,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Update comment - name: Update comment
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'update-comment' actions: 'update-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -389,14 +400,14 @@ jobs:
contents: 'eyes' contents: 'eyes'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| comment-id | The comment ID | number | ✔ | v1 | | comment-id | The comment ID | number | ✔ |
| body | Update the content of comment | string | ✖ | v1 | | body | Update the content of comment | string | ✖ |
| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | v1 | | update-mode | Update mode. Default `replace`, another `append` | string | ✖ |
| contents | Add [reaction](/en-US/guide/ref#-reactions-type) | string | ✖ | v1.1 | | contents | Add [reaction](/en-US/guide/ref#-reactions-type) | string | ✖ |
- When `body` is not entered, it will remain as it is - 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 `update-mode` is `append`, additional operations will be performed. Anything other than `append` will be replaced. Only effective for `body`
@@ -407,7 +418,7 @@ Update the specified issue according to the `issue-number`.
```yml ```yml
- name: Update issue - name: Update issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'update-issue' actions: 'update-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -421,18 +432,18 @@ Update the specified issue according to the `issue-number`.
contents: '+1' contents: '+1'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| issue-number | The number of issue | number | ✔ | v1 | | issue-number | The number of issue | number | ✔ |
| state | Modify the status of issue, optional value `open` `closed` | string | ✖ | v1 | | state | Modify the status of issue, optional value `open` `closed` | string | ✖ |
| title | Modify the title of the issue | string | ✖ | v1 | | title | Modify the title of the issue | string | ✖ |
| body | Modify the content of issue | string | ✖ | v1 | | body | Modify the content of issue | string | ✖ |
| update-mode | Update mode. Default `replace`, another `append` | string | ✖ | v1 | | update-mode | Update mode. Default `replace`, another `append` | string | ✖ |
| labels | Replace the labels of issue | string | ✖ | v1.1 | | labels | Replace the labels of issue | string | ✖ |
| assignees | Replace the assignees of issue | string | ✖ | v1.1 | | assignees | Replace the assignees of issue | string | ✖ |
| contents | Add [reaction](/en-US/guide/ref#-reactions-type) | string | ✖ | v1.1 | | contents | Add [reaction](/en-US/guide/ref#-reactions-type) | string | ✖ |
- `state` defaults to `open` - `state` defaults to `open`
- When the option is not filled, it will keep the original - When the option is not filled, it will keep the original
@@ -455,7 +466,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: welcome - name: welcome
uses: actions-cool/issues-helper@v1.3 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'welcome' actions: 'welcome'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -465,13 +476,13 @@ jobs:
issue-contents: '+1, -1, eyes' issue-contents: '+1, -1, eyes'
``` ```
| Param | Desc | Type | Required | Version | | Param | Desc | Type | Required |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | Action type | string | ✔ | v1.3 | | actions | Action type | string | ✔ |
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ | v1.3 | | token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
| body | Comment on the welcome content, no comment if you leave it blank | string | ✖ | v1.3 | | body | Comment on the welcome content, no comment if you leave it blank | string | ✖ |
| labels | Add labels to this issue | string | ✖ | v1.3 | | labels | Add labels to this issue | string | ✖ |
| assignees | Add assignees to this issue | string | ✖ | v1.3 | | assignees | Add assignees to this issue | string | ✖ |
| issue-contents | Add [reaction](/en-US/guide/ref#-reactions-type) to this issue| string | ✖ | v1.3 | | issue-contents | Add [reaction](/en-US/guide/ref#-reactions-type) to this issue| string | ✖ |
- If these 4 options are not filled, no operation - If these 4 options are not filled, no operation

View File

@@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Add assigness - name: Add assigness
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'add-assignees' actions: 'add-assignees'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -30,18 +30,18 @@ jobs:
assignees: 'xxx' or 'xx1,xx2' assignees: 'xxx' or 'xx1,xx2'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| assignees | 指定人。当不填或者为空字符时,不操作 | string | ✖ | v1.1 | | assignees | 指定人。当不填或者为空字符时,不操作 | string | ✖ |
- `actions` 支持多个,需用逗号隔开。如:`add-assignees,add-labels` - `actions` 支持多个,需用逗号隔开。如:`add-assignees,add-labels`
- 其中的 `name` 可根据自行根据实际情况修改 - 其中的 `name` 可根据自行根据实际情况修改
- [on 参考](/guide/ref#-github-相关文档) - [on 参考](/guide/ref#-github-相关文档)
- `${{ github.event.issue.number }}` 表示当前 issue[更多参考](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events) - `${{ github.event.issue.number }}` 表示当前 issue[更多参考](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events)
- `assignees` 支持多个,需用逗号隔开。注意设置多个需使用v1.1以上版本 - `assignees` 支持多个,需用逗号隔开
## `add-labels` ## `add-labels`
@@ -60,7 +60,7 @@ jobs:
if: contains(github.event.issue.body, 'xxx') == false if: contains(github.event.issue.body, 'xxx') == false
steps: steps:
- name: Add labels - name: Add labels
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'add-labels' actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -68,14 +68,14 @@ jobs:
labels: 'bug' or 'bug1,bug2' labels: 'bug' or 'bug1,bug2'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| labels | 新增的 labels。当不填或者为空字符时不新增 | string | ✖ | v1.1 | | labels | 新增的 labels。当不填或者为空字符时不新增 | string | ✖ |
- `labels` 支持多个,需用逗号隔开。注意设置多个需使用v1.1以上版本 - `labels` 支持多个,需用逗号隔开
## `close-issue` ## `close-issue`
@@ -83,7 +83,7 @@ jobs:
```yml ```yml
- name: Close issue - name: Close issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'close-issue' actions: 'close-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -91,11 +91,11 @@ jobs:
body: 'This is auto closed.' body: 'This is auto closed.'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
## `create-comment` ## `create-comment`
@@ -114,7 +114,7 @@ jobs:
if: github.event.label.name == 'xxx' if: github.event.label.name == 'xxx'
steps: steps:
- name: Create comment - name: Create comment
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'create-comment' actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -126,19 +126,19 @@ jobs:
contents: '+1' or '+1,heart' contents: '+1' or '+1,heart'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| body | 新增评论的内容 | string | ✖ | v1 | | body | 新增评论的内容 | string | ✖ |
| contents | 为新增评论的增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ | v1.1 | | contents | 为新增评论的增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ |
- `body` 默认为:`Currently at ${owner}/${repo}. And this is default comment.` - `body` 默认为:`Currently at ${owner}/${repo}. And this is default comment.`
- 其中 `${owner}/${repo}` 表示当前仓库 - 其中 `${owner}/${repo}` 表示当前仓库
- 返回 `comment-id`,可用于之后操作。[用法参考](/guide/ref#-outputs-使用) - 返回 `comment-id`,可用于之后操作。[用法参考](/guide/ref#-outputs-使用)
- `${{ github.event.issue.user.login }}` 表示该 issue 的创建者 - `${{ github.event.issue.user.login }}` 表示该 issue 的创建者
- `contents` 支持多个,需用逗号隔开。注意设置多个需使用v1.1以上版本 - `contents` 支持多个,需用逗号隔开
## `create-issue` ## `create-issue`
@@ -156,7 +156,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Create issue - name: Create issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'create-issue' actions: 'create-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -167,15 +167,15 @@ jobs:
contents: '+1' contents: '+1'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| title | 新增 issue 的标题 | string | ✖ | v1 | | title | 新增 issue 的标题 | string | ✖ |
| body | 新增 issue 的内容 | string | ✖ | v1 | | body | 新增 issue 的内容 | string | ✖ |
| labels | 为新增 issue 添加 labels | string | ✖ | v1.1 | | labels | 为新增 issue 添加 labels | string | ✖ |
| assignees | 为新增 issue 添加 assignees | string | ✖ | v1.1 | | assignees | 为新增 issue 添加 assignees | string | ✖ |
| contents | 为新增 issue 增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ | v1.1 | | contents | 为新增 issue 增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ |
- `title` 默认为:`Default Title` - `title` 默认为:`Default Title`
- 返回 `issue-number`[用法参考](/guide/ref#-outputs-使用) - 返回 `issue-number`[用法参考](/guide/ref#-outputs-使用)
@@ -186,18 +186,18 @@ jobs:
```yml ```yml
- name: Delete comment - name: Delete comment
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'delete-comment' actions: 'delete-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
comment-id: xxx comment-id: xxx
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| comment-id | 指定的 comment | number | ✔ | v1 | | comment-id | 指定的 comment | number | ✔ |
## `lock-issue` ## `lock-issue`
@@ -216,49 +216,60 @@ jobs:
if: github.event.label.name == 'invalid' if: github.event.label.name == 'invalid'
steps: steps:
- name: Lock issue - name: Lock issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'lock-issue' actions: 'lock-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }} issue-number: ${{ github.event.issue.number }}
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
## `mark-duplicate` ## `mark-duplicate`
快捷标记重复问题。 快捷标记重复问题,仅作用于 issue 新增评论
```yml ```yml
name: Issue Mark Duplicate name: Issue Mark Duplicate
on: on:
issue_comment: issue_comment:
types: [created, edited] types: [created]
jobs: jobs:
mark-duplicate: mark-duplicate:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: mark-duplicate - name: mark-duplicate
uses: actions-cool/issues-helper@v1.5 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'mark-duplicate' actions: 'mark-duplicate'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1.5 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1.5 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| duplicate-command | 操作命令,默认为 `/d` | string | ✖ | v1.5 | | duplicate-command | 可设置简洁命令,如:`/d` | string | ✖ |
| duplicate-labels | 为该 issue 额外增加 labels | string | ✖ | v1.5 | | duplicate-labels | 为该 issue 额外增加 labels | string | ✖ |
| labels | 替换该 issue 的 labels | string | ✖ | v1.5 | | remove-labels | 设置可移除的 labels | string | ✖ |
| contents | 为该评论的增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ | v1.5 | | labels | 替换该 issue 的 labels | string | ✖ |
| contents | 为该评论的增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ |
| close-issue | 是否同时关闭该 issue | string | ✖ |
- `duplicate-command`:当设置简洁命令时,同时仍支持原有 `Duplicate of`
- `close-issue``true``'true'` 均可生效
<Alert>
注意:使用简洁命令创建的 Duplicate 不显示下图红框内容。但其实这个没有任何影响的。
</Alert>
![](../public/duplicate.png)
## `open-issue` ## `open-issue`
@@ -266,18 +277,18 @@ jobs:
```yml ```yml
- name: Open issue - name: Open issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'open-issue' actions: 'open-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: xxx issue-number: xxx
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
## `remove-assignees` ## `remove-assignees`
@@ -285,7 +296,7 @@ jobs:
```yml ```yml
- name: Remove assignees - name: Remove assignees
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'remove-assignees' actions: 'remove-assignees'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -293,12 +304,12 @@ jobs:
assignees: 'xx' assignees: 'xx'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| assignees | 移除的指定人。当为空字符时,不进行移除 | string | ✔ | v1.1 | | assignees | 移除的指定人。当为空字符时,不进行移除 | string | ✔ |
## `remove-labels` ## `remove-labels`
@@ -306,7 +317,7 @@ jobs:
```yml ```yml
- name: Remove labels - name: Remove labels
uses: actions-cool/issues-helper@v1.2 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'remove-labels' actions: 'remove-labels'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -314,12 +325,12 @@ jobs:
labels: 'xx' labels: 'xx'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1.2 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1.2 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1.2 | | issue-number | 指定的 issue | number | ✔ |
| labels | 移除的 labels。当为空字符时不进行移除 | string | ✔ | v1.2 | | labels | 移除的 labels。当为空字符时不进行移除 | string | ✔ |
- `labels` 支持多个,如 `x1,x2,x3`,只会移除 issue 已添加的 labels - `labels` 支持多个,如 `x1,x2,x3`,只会移除 issue 已添加的 labels
@@ -329,7 +340,7 @@ jobs:
```yml ```yml
- name: Set labels - name: Set labels
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'set-labels' actions: 'set-labels'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -337,12 +348,12 @@ jobs:
labels: 'xx' labels: 'xx'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| labels | labels 设置。当空字符时,会移除所有 | string | ✔ | v1.1 | | labels | labels 设置。当空字符时,会移除所有 | string | ✔ |
## `unlock-issue` ## `unlock-issue`
@@ -350,18 +361,18 @@ jobs:
```yml ```yml
- name: Unlock issue - name: Unlock issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'unlock-issue' actions: 'unlock-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }} issue-number: ${{ github.event.issue.number }}
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
## `update-comment` ## `update-comment`
@@ -381,7 +392,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Update comment - name: Update comment
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'update-comment' actions: 'update-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -389,14 +400,14 @@ jobs:
contents: 'eyes' contents: 'eyes'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| comment-id | 指定的 comment | number | ✔ | v1 | | comment-id | 指定的 comment | number | ✔ |
| body | 更新 comment 的内容 | string | ✖ | v1 | | body | 更新 comment 的内容 | string | ✖ |
| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ | v1 | | update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ |
| contents | 增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ | v1.1 | | contents | 增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ |
- `body` 不填时,会保持原有 - `body` 不填时,会保持原有
- `update-mode``append` 时,会进行附加操作。非 `append` 都会进行替换。仅对 `body` 生效 - `update-mode``append` 时,会进行附加操作。非 `append` 都会进行替换。仅对 `body` 生效
@@ -407,7 +418,7 @@ jobs:
```yml ```yml
- name: Update issue - name: Update issue
uses: actions-cool/issues-helper@v1 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'update-issue' actions: 'update-issue'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -421,18 +432,18 @@ jobs:
contents: '+1' contents: '+1'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| issue-number | 指定的 issue | number | ✔ | v1 | | issue-number | 指定的 issue | number | ✔ |
| state | 修改 issue 的状态,可选值 `open` `closed` | string | ✖ | v1 | | state | 修改 issue 的状态,可选值 `open` `closed` | string | ✖ |
| title | 修改 issue 的标题 | string | ✖ | v1 | | title | 修改 issue 的标题 | string | ✖ |
| body | 修改 issue 的内容 | string | ✖ | v1 | | body | 修改 issue 的内容 | string | ✖ |
| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ | v1 | | update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ |
| labels | 替换 issue 的 labels | string | ✖ | v1.1 | | labels | 替换 issue 的 labels | string | ✖ |
| assignees | 替换 issue 的 assignees | string | ✖ | v1.1 | | assignees | 替换 issue 的 assignees | string | ✖ |
| contents | 增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ | v1.1 | | contents | 增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ |
- `state` 默认为 `open` - `state` 默认为 `open`
- 当可选项不填时,会保持原有 - 当可选项不填时,会保持原有
@@ -454,7 +465,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: welcome - name: welcome
uses: actions-cool/issues-helper@v1.3 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'welcome' actions: 'welcome'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -464,13 +475,13 @@ jobs:
issue-contents: '+1, -1, eyes' issue-contents: '+1, -1, eyes'
``` ```
| 参数 | 描述 | 类型 | 必填 | 版本 | | 参数 | 描述 | 类型 | 必填 |
| -- | -- | -- | -- | -- | | -- | -- | -- | -- |
| actions | 操作类型 | string | ✔ | v1.3 | | actions | 操作类型 | string | ✔ |
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ | v1.3 | | token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
| body | 评论欢迎的内容,不填则不评论 | string | ✖ | v1.3 | | body | 评论欢迎的内容,不填则不评论 | string | ✖ |
| labels | 为该 issue 增加 labels | string | ✖ | v1.3 | | labels | 为该 issue 增加 labels | string | ✖ |
| assignees | 为该 issue 增加 assignees | string | ✖ | v1.3 | | assignees | 为该 issue 增加 assignees | string | ✖ |
| issue-contents | 为该 issue 增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ | v1.3 | | issue-contents | 为该 issue 增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ |
- 若这 4 个可选项都不填,则无操作 - 若这 4 个可选项都不填,则无操作

View File

@@ -9,7 +9,6 @@ toc: menu
- v1 represents the initial version - v1 represents the initial version
- The fixes and additions to the v1 version will be released to the v1.1 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 - 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 - 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) - It is recommended to use the latest releases version. It can be seen in [releases](https://github.com/actions-cool/issues-helper/releases)

View File

@@ -9,7 +9,6 @@ toc: menu
- v1 表示初始版本 - v1 表示初始版本
- 对 v1 版本的修复和新增会发布到 v1.1 版本 - 对 v1 版本的修复和新增会发布到 v1.1 版本
- 当发布的 v1.x 运行一定时间稳定后,发布进阶 v2 版本 - 当发布的 v1.x 运行一定时间稳定后,发布进阶 v2 版本
- API 中参数需使用其中最大及以上版本
- 版本选择 - 版本选择
- 建议采用最新 releases 版本。可在 [releases](https://github.com/actions-cool/issues-helper/releases) 看到 - 建议采用最新 releases 版本。可在 [releases](https://github.com/actions-cool/issues-helper/releases) 看到

24
docs/guide/note.en-US.md Normal file
View File

@@ -0,0 +1,24 @@
---
toc: menu
---
<Alert type="success">
Here are some things I summarized in my use, I hope it can help you.
</Alert>
## 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).
## `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.

25
docs/guide/note.md Normal file
View File

@@ -0,0 +1,25 @@
---
toc: menu
---
<Alert type="success">
这里记录自己在使用中总结的一些东西,希望可以帮助到你。
</Alert>
## `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)。
## `GitHub Actions bot` 触发
当设置了一个 Actions如为给一个 issue 新增 label `x1`Actions 自动为该 issue 增加 `x2` label。
但如果这个是由 `GitHub Actions bot` 完成的(即 actions 中 token 不传,或使用默认 `token: ${{ secrets.GITHUB_TOKEN }}`),则不会触发 label `x2` 的 Actions。

View File

@@ -38,7 +38,7 @@ jobs:
steps: steps:
- name: help wanted - name: help wanted
if: github.event.label.name == 'help wanted' if: github.event.label.name == 'help wanted'
uses: actions-cool/issues-helper@v1.2 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'create-comment' actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -51,7 +51,7 @@ jobs:
## 💖 Who is using? ## 💖 Who is using?
<code src="./users.tsx" inline /> <embed src="../README.md#L997-L1044"></embed>
## ⚡ Feedback ## ⚡ Feedback

View File

@@ -38,7 +38,7 @@ jobs:
steps: steps:
- name: help wanted - name: help wanted
if: github.event.label.name == 'help wanted' if: github.event.label.name == 'help wanted'
uses: actions-cool/issues-helper@v1.2 uses: actions-cool/issues-helper@v1.8
with: with:
actions: 'create-comment' actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -51,7 +51,7 @@ jobs:
## 💖 谁在使用? ## 💖 谁在使用?
<code src="./users.tsx" inline /> <embed src="../README.md#L997-L1044"></embed>
## ⚡ 反馈 ## ⚡ 反馈

View File

@@ -1,71 +0,0 @@
/* eslint-disable react/jsx-no-target-blank */
import React from 'react';
const USERS = [
{
name: 'ant-design',
link: 'https://github.com/ant-design/ant-design',
logo: 'https://avatars1.githubusercontent.com/u/12101536?s=200&v=4',
},
{
name: 'ant-design-vue',
link: 'https://github.com/vueComponent/ant-design-vue',
logo: 'https://avatars2.githubusercontent.com/u/32120805?s=200&v=4',
},
{
name: 'dumi',
link: 'https://github.com/umijs/dumi',
logo: 'https://avatars2.githubusercontent.com/u/33895495?s=200&v=4',
},
{
name: 'umi',
link: 'https://github.com/umijs/umi',
logo: 'https://avatars2.githubusercontent.com/u/33895495?s=200&v=4',
},
{
name: 'vue-request',
link: 'https://github.com/AttoJS/vue-request',
logo: 'https://raw.githubusercontent.com/AttoJS/art/master/vue-request-logo.png',
}
];
export default () => {
return (
<ul style={{ display: 'flex', flexWrap: 'wrap', margin: 0, padding: 0, listStyle: 'none' }}>
{USERS.map((user, i) => (
<li
key={user.link}
style={{
width: 220,
marginRight: i === USERS.length - 1 ? 0 : 16,
marginBottom: 8,
border: '1px solid #eee',
textAlign: 'center',
fontSize: 20,
fontWeight: 600,
borderRadius: 2,
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}}
>
<a
style={{ display: 'block', color: '#666', padding: '18px', textDecoration: 'none' }}
target="_blank"
href={user.link}
>
<img
width={(user.name && 40) || undefined}
height={(!user.name && 40) || undefined}
style={{ verticalAlign: '-0.32em' }}
src={user.logo}
alt={user.name}
/>
<div style={{ marginTop: 10 }}>{user.name}</div>
</a>
</li>
))}
</ul>
);
};

View File

@@ -1,6 +1,6 @@
{ {
"name": "issue-helper", "name": "issue-helper",
"version": "1.5.0", "version": "1.7.0",
"private": true, "private": true,
"description": "Some operations on issue.", "description": "Some operations on issue.",
"main": "src/main.js", "main": "src/main.js",
@@ -10,7 +10,10 @@
"docs-dev:build": "UMI_ENV=dev dumi build", "docs-dev:build": "UMI_ENV=dev dumi build",
"docs:deploy": "gh-pages -d docs-dist", "docs:deploy": "gh-pages -d docs-dist",
"deploy": "npm run docs:build && npm run docs:deploy", "deploy": "npm run docs:build && npm run docs:deploy",
"package": "ncc build src/main.js -o dist" "package": "ncc build src/main.js -o dist",
"up-users": "node ./script/update-users.js",
"main": "node ./src/main.js",
"up-version": "node ./script/update-version.js"
}, },
"author": "xrkffgg", "author": "xrkffgg",
"license": "MIT", "license": "MIT",
@@ -33,8 +36,9 @@
}, },
"devDependencies": { "devDependencies": {
"@vercel/ncc": "^0.25.1", "@vercel/ncc": "^0.25.1",
"common-tags": "^1.8.0",
"dotenv": "^8.2.0", "dotenv": "^8.2.0",
"dumi": "^1.1.0-rc.8", "dumi": "^1.1.0",
"gh-pages": "^3.1.0", "gh-pages": "^3.1.0",
"react": "^17.0.1" "react": "^17.0.1"
} }

BIN
public/duplicate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
public/month.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

81
script/update-users.js Normal file
View File

@@ -0,0 +1,81 @@
const { readFileSync, writeFileSync } = require('fs');
const { stripIndent } = require('common-tags');
// **************************************************************************
let { users } = require('../USERS.js');
users.sort((a, b) => getName(a).localeCompare(getName(b)));
// **************************************************************************
let table = '';
let row = users.length / 4;
let lastNo = users.length % 4;
if (lastNo != 0) row += 1;
for (let j = 1; j <= row; j++) {
let data = '';
data = stripIndent`
<tr>
<td align="center" width="180">${getImg(users[(j-1)*4])}</td>
<td align="center" width="180">${getImg(users[(j-1)*4+1])}</td>
<td align="center" width="180">${getImg(users[(j-1)*4+2])}</td>
<td align="center" width="180">${getImg(users[(j-1)*4+3])}</td>
</tr>`;
table += data
};
table = `<table>
${table}
</table>
`;
// **************************************************************************
const point = '<table>';
const last = `
## LICENSE
[MIT](https://github.com/actions-cool/issues-helper/blob/main/LICENSE)
`;
// **************************************************************************
const cn = readFileSync('./README.md', 'utf8');
const cnIn = cn.indexOf(point);
const cnBefore = cn.substring(0, cnIn);
const newcn = cnBefore + table + last;
writeFileSync('./README.md', newcn);
console.log(`🎉 Done cn`);
// **************************************************************************
const en = readFileSync('./README.en-US.md', 'utf8');
const enIn = en.indexOf(point);
const enBefore = en.substring(0, enIn);
const newen = enBefore + table + last;
writeFileSync('./README.en-US.md', newen);
console.log(`🎉 Done en`);
// **************************************************************************
function getImg (o) {
if (o) {
return `
<a href="${o.url}">
<img src="${o.logo}" width="46" />
<br />
${getName(o)}
</a>`
}
return ``
};
function getName (o) {
if (o) {
return o.url.split('/').slice(-1)[0]
}
return ``
};
// **************************************************************************

44
script/update-version.js Normal file
View File

@@ -0,0 +1,44 @@
const { readFileSync, writeFileSync } = require('fs');
const last = /v1\.7/g;
const now = 'v1.8';
let readme = readFileSync('./README.md', 'utf-8');
readme = readme.replace(last, now);
writeFileSync('./README.md', readme);
console.log('readme done!');
let readmeen = readFileSync('./README.en-US.md', 'utf-8');
readmeen = readmeen.replace(last, now);
writeFileSync('./README.en-US.md', readmeen);
console.log('readmeen done!');
let index = readFileSync('./docs/index.md', 'utf-8');
index = index.replace(last, now);
writeFileSync('./docs/index.md', index);
console.log('index done!');
let indexen = readFileSync('./docs/index.en-US.md', 'utf-8');
indexen = indexen.replace(last, now);
writeFileSync('./docs/index.en-US.md', indexen);
console.log('indexen done!');
let base = readFileSync('./docs/base.md', 'utf-8');
base = base.replace(last, now);
writeFileSync('./docs/base.md', base);
console.log('base done!');
let baseen = readFileSync('./docs/base.en-US.md', 'utf-8');
baseen = baseen.replace(last, now);
writeFileSync('./docs/base.en-US.md', baseen);
console.log('baseen done!');
let adv = readFileSync('./docs/advanced.md', 'utf-8');
adv = adv.replace(last, now);
writeFileSync('./docs/advanced.md', adv);
console.log('adv done!');
let adven = readFileSync('./docs/advanced.en-US.md', 'utf-8');
adven = adven.replace(last, now);
writeFileSync('./docs/advanced.en-US.md', adven);
console.log('adven done!');

View File

@@ -2,51 +2,60 @@ require('dotenv').config();
const core = require("@actions/core"); const core = require("@actions/core");
const { Octokit } = require('@octokit/rest'); const { Octokit } = require('@octokit/rest');
const {
doAddLabels,
doCreateComment,
doCloseIssue,
doLockIssue,
doCreateIssue,
} = require('./base.js');
const {
doQueryIssues,
getIssuesInMonth,
getCreatedMonth,
} = require('./public.js');
const {
dealInput,
matchKeyword,
getPreMonth
} = require('./util.js');
// **************************************************************************
var dayjs = require('dayjs'); var dayjs = require('dayjs');
var utc = require('dayjs/plugin/utc'); var utc = require('dayjs/plugin/utc');
dayjs.extend(utc); dayjs.extend(utc);
var isSameOrBefore = require('dayjs/plugin/isSameOrBefore');
dayjs.extend(isSameOrBefore);
const {
doAddLabels,
doCloseIssue,
doCreateComment,
doLockIssue
} = require('./base.js');
const { dealInput, matchKeyword } = require('./util.js');
// **************************************************************************
const token = core.getInput('token'); const token = core.getInput('token');
const octokit = new Octokit({ auth: `token ${token}` }); const octokit = new Octokit({ auth: `token ${token}` });
let direction = core.getInput("direction"); let direction = core.getInput("direction");
direction = direction === 'desc' ? 'desc' : 'asc'; direction = direction === 'desc' ? 'desc' : 'asc';
const commentAuth = core.getInput("comment-auth"); const commentAuth = core.getInput("comment-auth");
const bodyIncludes = core.getInput('body-includes'); const bodyIncludes = core.getInput('body-includes');
const titleIncludes = core.getInput('title-includes'); const titleIncludes = core.getInput('title-includes');
const assigneeIncludes = core.getInput('assignee-includes'); const assigneeIncludes = core.getInput('assignee-includes');
const issueCreator = core.getInput("issue-creator"); let issueState = core.getInput("issue-state") || 'open';
const issueAssignee = core.getInput('issue-assignee'); if (issueState != 'all' && issueState != 'closed') {
const issueMentioned = core.getInput('issue-mentioned'); issueState = 'open';
let issueState = core.getInput("issue-state") || 'all';
if (issueState != 'open' && issueState != 'closed') {
issueState = 'all';
} }
const inactiveDay = core.getInput("inactive-day");
const inactiveLabel = core.getInput("inactive-label") || 'inactive'; const inactiveLabel = core.getInput("inactive-label") || 'inactive';
// **************************************************************************
async function doCheckInactive (owner, repo, labels) { async function doCheckInactive (owner, repo, labels) {
const issues = await doQueryIssues(owner, repo, labels, issueState); const issues = await doQueryIssues(owner, repo, labels, issueState);
if (issues.length) { if (issues.length) {
for (let i = 0; i < issues.length; i++) { for (let i = 0; i < issues.length; i++) {
if (!JSON.stringify(issues[i].labels).includes(inactiveLabel)) { let arr = [];
issues[i].labels.forEach(it => {
arr.push(it.name);
});
if (!arr.includes(inactiveLabel)) {
await doAddLabels(owner, repo, issues[i].number, inactiveLabel); await doAddLabels(owner, repo, issues[i].number, inactiveLabel);
if (core.getInput("body")) { if (core.getInput("body")) {
await doCreateComment(owner, repo, issues[i].number, core.getInput("body")); await doCreateComment(owner, repo, issues[i].number, core.getInput("body"));
@@ -165,64 +174,133 @@ async function doLockIssues (owner, repo, labels) {
} }
}; };
async function doQueryIssues (owner, repo, labels, state, creator) { async function doMonthStatistics (owner, repo, labels, assignees) {
let params = { const countLables = core.getInput("count-lables");
const countComments = core.getInput("count-comments");
const thisMonth = dayjs.utc().month() + 1;
const year = thisMonth == 1 ? dayjs.utc().year() - 1 : dayjs.utc().year();
const month = getPreMonth(thisMonth);
const showMonth = month < 10 ? `0${month}` : month;
let issues = await getIssuesInMonth(
owner, owner,
repo, repo,
state, thisMonth
}; );
if (issues.length == 0) {
issueCreator ? params.creator = issueCreator : null; core.info(`Actions: [query-issues-${month}] empty!`);
issueAssignee ? params.assignee = issueAssignee : null; return false;
issueMentioned ? params.mentioned = issueMentioned : null;
if (labels) {
params.labels = labels;
} }
issues = issues.filter(i => {
if (creator) { return getCreatedMonth(i.created_at) == month
params.creator = creator; });
} let total = issues.length;
let totalIssues = [...issues];
const res = await octokit.issues.listForRepo(params); let openTotal = 0;
let issues = []; let openIssuesNumber = [];
let issueNumbers = []; let closeTotal = 0;
if (res.data.length) { let closeIssuesNumber = [];
res.data.forEach(iss => { let labelsTotals = [];
const a = bodyIncludes ? iss.body.includes(bodyIncludes) : true; const title = `[${owner}/${repo}] Month Statistics: ${year}-${showMonth}`;
const b = titleIncludes ? iss.title.includes(titleIncludes) : true; for (let i = 0; i < issues.length; i++) {
/** if (issues[i].state == 'closed') {
* Note: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. closeTotal += 1;
* For this reason, "Issues" endpoints may return both issues and pull requests in the response. closeIssuesNumber.push(issues[i].number);
* You can identify pull requests by the pull_request key. } else if (issues[i].state == 'open') {
*/ openTotal += 1;
if (a && b && iss.pull_request === undefined) { openIssuesNumber.push(issues[i].number);
if (inactiveDay) { }
let lastTime = dayjs.utc().subtract(Number(inactiveDay), 'day'); if (countLables && issues[i].labels) {
let updateTime = dayjs.utc(iss.updated_at); issues[i].labels.forEach(l => {
if (updateTime.isSameOrBefore(lastTime)) { if (l.name in labelsTotals) {
issues.push(iss); labelsTotals[l.name] += 1;
issueNumbers.push(iss.number);
}
} else { } else {
issues.push(iss); labelsTotals[l.name] = 1;
issueNumbers.push(iss.number);
} }
} })
}
}
let now = dayjs().utc().format('YYYY-MM-DD HH:mm:ss');
let body = `
- Created time: ${now}
- Time base: UTC +0
`;
let totalShow = `
### Count
| Total | Open | Closed |
| -- | -- | -- |
| ${total} | ${openTotal} | ${closeTotal} |
`;
body += totalShow;
if (countLables == 'true') {
let labelsArr = [];
for (var lab in labelsTotals) {
labelsArr.push({
labelName: lab,
number: labelsTotals[lab]
})
}
labelsArr.sort((a, b) => b.number - a.number);
let labelsTitle = `
### Labels statistics
<table>
<tr>
<th>Name</th>
<th>Number</th>
</tr>`
let labelsBody = '';
labelsArr.forEach(it => {
labelsBody += `<tr><td>${it.labelName}</td><td>${it.number}</td></tr>`
}) })
core.info(`Actions: [query-issues]: [${JSON.stringify(issueNumbers)}]!`); body = body + labelsTitle + labelsBody + `</table>
`;
} }
return issues; if (countComments == 'true') {
totalIssues.sort((a, b) => b.comments - a.comments);
const maxComments = totalIssues.slice(0, 3);
let commentTitle = `
### Most comments
<table>
<tr>
<th>#</th>
<th>Issue</th>
<th>Title</th>
<th>Number</th>
<th>State</th>
</tr>
`
let commentBody = '';
maxComments.forEach((it,ind) => {
commentBody += `<tr>
<td>${ind + 1}</td>
<td>${it.number}</td>
<td>${it.title}</td>
<td>${it.comments}</td>
<td>${it.state}</td></tr>`
})
body = body + commentTitle + commentBody + '</table>';
}
await doCreateIssue(owner, repo, title, body, labels, assignees);
}; };
// **************************************************************************
module.exports = { module.exports = {
doCheckInactive, doCheckInactive,
doCheckIssue, doCheckIssue,
doCloseIssues, doCloseIssues,
doFindComments, doFindComments,
doLockIssues, doLockIssues,
doMonthStatistics,
// tool
doQueryIssues,
}; };

4
src/app.jsx Normal file
View File

@@ -0,0 +1,4 @@
// Just for dumi style
import './less/main.less';
import './less/markdown.less';
import './less/dumi.less';

View File

@@ -3,8 +3,7 @@ const core = require("@actions/core");
const github = require("@actions/github"); const github = require("@actions/github");
const { Octokit } = require('@octokit/rest'); const { Octokit } = require('@octokit/rest');
const { doQueryIssues } = require('./advanced.js'); // **************************************************************************
const ALLREACTIONS = [ const ALLREACTIONS = [
"+1", "+1",
"-1", "-1",
@@ -16,16 +15,23 @@ const ALLREACTIONS = [
"eyes", "eyes",
]; ];
const { dealInput } = require('./util.js'); const {
doQueryIssues
} = require('./public.js');
const {
dealInput,
testDuplicate,
} = require('./util.js');
// **************************************************************************
const token = core.getInput('token'); const token = core.getInput('token');
const octokit = new Octokit({ auth: `token ${token}` }); const octokit = new Octokit({ auth: `token ${token}` });
const contents = core.getInput("contents");
const issueContents = core.getInput("issue-contents");
const context = github.context; const context = github.context;
const contents = core.getInput("contents");
// **************************************************************************
async function doAddAssignees (owner, repo, issueNumber, assignees) { async function doAddAssignees (owner, repo, issueNumber, assignees) {
await octokit.issues.addAssignees({ await octokit.issues.addAssignees({
owner, owner,
@@ -145,22 +151,41 @@ async function doMarkDuplicate (owner, repo, labels) {
core.info(`This actions only support on 'issue_comment'!`); core.info(`This actions only support on 'issue_comment'!`);
return false; return false;
} }
const duplicateCommand = core.getInput("duplicate-command") || '/d'; if (context.payload.action != 'created') {
core.info(`This actions only support on 'issue_comment' created!`);
return false;
}
const duplicateCommand = core.getInput("duplicate-command");
const duplicateLabels = core.getInput("duplicate-labels"); const duplicateLabels = core.getInput("duplicate-labels");
const removeLables = core.getInput("remove-labels");
const closeIssue = core.getInput("close-issue");
const commentId = context.payload.comment.id; const commentId = context.payload.comment.id;
const commentBody = context.payload.comment.body; const commentBody = context.payload.comment.body;
const issueNumber = context.payload.issue.number; const issueNumber = context.payload.issue.number;
if (commentBody.startsWith(duplicateCommand) && commentBody.split(' ')[0] == duplicateCommand) { const ifCommandInput = !!duplicateCommand;
const nextBody = commentBody.replace(duplicateCommand, 'Duplicate of');
await doUpdateComment(owner, repo, commentId, nextBody, 'replace', true); if ((ifCommandInput && commentBody.startsWith(duplicateCommand) && commentBody.split(' ')[0] == duplicateCommand) || testDuplicate(commentBody)) {
if (ifCommandInput) {
const nextBody = commentBody.replace(duplicateCommand, 'Duplicate of');
await doUpdateComment(owner, repo, commentId, nextBody, 'replace', true);
} else if (contents) {
await doCreateCommentContent(owner, repo, commentId, dealInput(contents));
}
if (duplicateLabels) { if (duplicateLabels) {
await doAddLabels(owner, repo, issueNumber, duplicateLabels); await doAddLabels(owner, repo, issueNumber, duplicateLabels);
} }
if (removeLables) {
await doRemoveLabels(owner, repo, issueNumber, removeLables);
}
if (labels) { if (labels) {
await doSetLabels(owner, repo, issueNumber, labels); await doSetLabels(owner, repo, issueNumber, labels);
} }
if (closeIssue == 'true') {
await doCloseIssue(owner, repo, issueNumber);
}
} else { } else {
core.info(`This comment body should start whith 'duplicate-command'`); core.info(`This comment body should start whith 'duplicate-command'`);
} }
@@ -332,14 +357,14 @@ async function doUpdateIssue (
async function doWelcome (owner, repo, assignees, labels, body) { async function doWelcome (owner, repo, assignees, labels, body) {
const context = github.context; const context = github.context;
const isIssue = !!context.payload.issue; const isIssue = !!context.payload.issue;
const issueContents = core.getInput("issue-contents");
if (!isIssue) { if (!isIssue) {
core.setFailed("The event that triggered this action must be a issue. Error!"); core.setFailed("The event that triggered this action must be a issue. Error!");
} else { } else {
const auth = context.payload.sender.login; const auth = context.payload.sender.login;
core.info(`Actions: [welcome: auth=][${auth}]`); core.info(`Actions: [welcome: auth=][${auth}]`);
const issueNumber = context.issue.number; const issueNumber = context.issue.number;
const creator = 'zoo-js-bot'; const issues = await doQueryIssues(owner, repo, false, 'all', auth);
const issues = await doQueryIssues(owner, repo, false, 'all', creator);
if (issues.length == 0 || (issues.length == 1 && issues[0].number == issueNumber)) { if (issues.length == 0 || (issues.length == 1 && issues[0].number == issueNumber)) {
if (core.getInput("body")) { if (core.getInput("body")) {
await doCreateComment(owner, repo, issueNumber, body); await doCreateComment(owner, repo, issueNumber, body);
@@ -364,7 +389,7 @@ async function doWelcome (owner, repo, assignees, labels, body) {
} }
}; };
// tool // **************************************************************************
function testContent(con) { function testContent(con) {
if (ALLREACTIONS.includes(con)) { if (ALLREACTIONS.includes(con)) {
return true; return true;
@@ -374,7 +399,7 @@ function testContent(con) {
} }
}; };
// exports // **************************************************************************
module.exports = { module.exports = {
doAddAssignees, doAddAssignees,
doAddLabels, doAddLabels,

56
src/less/dumi.less Normal file

File diff suppressed because one or more lines are too long

3
src/less/main.less Normal file
View File

@@ -0,0 +1,3 @@
html {
scroll-behavior: smooth;
}

15
src/less/markdown.less Normal file
View File

@@ -0,0 +1,15 @@
.markdown table {
width: auto !important;
}
.markdown table td:first-child {
font-weight: normal !important;
}
code {
padding: 1px 5px !important;
border-radius: 4px;
background: rgba(0, 0, 0, 0.06) !important;
box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.1);
border: 1px solid rgba(0,0,0,0.1);
}

View File

@@ -1,14 +1,13 @@
const core = require("@actions/core"); const core = require("@actions/core");
const github = require("@actions/github"); const github = require("@actions/github");
// **************************************************************************
const { const {
doAddAssignees, doAddAssignees,
doAddLabels, doAddLabels,
doCloseIssue, doCloseIssue,
doCreateComment, doCreateComment,
doCreateCommentContent,
doCreateIssue, doCreateIssue,
doCreateIssueContent,
doDeleteComment, doDeleteComment,
doMarkDuplicate, doMarkDuplicate,
doLockIssue, doLockIssue,
@@ -28,8 +27,10 @@ const {
doCloseIssues, doCloseIssues,
doFindComments, doFindComments,
doLockIssues, doLockIssues,
doMonthStatistics,
} = require('./advanced.js'); } = require('./advanced.js');
// **************************************************************************
const ALLACTIONS = [ const ALLACTIONS = [
// base // base
'add-assignees', 'add-assignees',
@@ -55,8 +56,10 @@ const ALLACTIONS = [
'close-issues', 'close-issues',
'find-comments', 'find-comments',
'lock-issues', 'lock-issues',
'month-statistics',
]; ];
// **************************************************************************
async function main() { async function main() {
try { try {
const owner = github.context.repo.owner; const owner = github.context.repo.owner;
@@ -207,6 +210,14 @@ async function main() {
labels labels
); );
break; break;
case 'month-statistics':
await doMonthStatistics(
owner,
repo,
labels,
assignees
);
break;
// default // default
default: default:
break; break;
@@ -218,4 +229,5 @@ async function main() {
} }
} }
// **************************************************************************
main(); main();

124
src/public.js Normal file
View File

@@ -0,0 +1,124 @@
require('dotenv').config();
const core = require("@actions/core");
const { Octokit } = require('@octokit/rest');
const {
getPreMonth
} = require('./util.js');
// **************************************************************************
var dayjs = require('dayjs');
var utc = require('dayjs/plugin/utc');
dayjs.extend(utc);
var isSameOrBefore = require('dayjs/plugin/isSameOrBefore');
dayjs.extend(isSameOrBefore);
// **************************************************************************
const token = core.getInput('token');
const octokit = new Octokit({ auth: `token ${token}` });
const perPage = 100;
const issueCreator = core.getInput("issue-creator");
const issueAssignee = core.getInput('issue-assignee');
const issueMentioned = core.getInput('issue-mentioned');
const bodyIncludes = core.getInput('body-includes');
const titleIncludes = core.getInput('title-includes');
const inactiveDay = core.getInput("inactive-day");
// **************************************************************************
async function doQueryIssues (owner, repo, labels, state, creator) {
let params = {
owner,
repo,
state,
};
issueCreator ? params.creator = issueCreator : null;
issueAssignee ? params.assignee = issueAssignee : null;
issueMentioned ? params.mentioned = issueMentioned : null;
if (labels) {
params.labels = labels;
}
if (creator) {
params.creator = creator;
}
const res = await getIssues(params);
let issues = [];
let issueNumbers = [];
if (res.length) {
res.forEach(iss => {
const a = bodyIncludes ? iss.body.includes(bodyIncludes) : true;
const b = titleIncludes ? iss.title.includes(titleIncludes) : true;
/**
* Note: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request.
* For this reason, "Issues" endpoints may return both issues and pull requests in the response.
* You can identify pull requests by the pull_request key.
*/
if (a && b && iss.pull_request === undefined) {
if (inactiveDay) {
let lastTime = dayjs.utc().subtract(Number(inactiveDay), 'day');
let updateTime = dayjs.utc(iss.updated_at);
if (updateTime.isSameOrBefore(lastTime)) {
issues.push(iss);
issueNumbers.push(iss.number);
}
} else {
issues.push(iss);
issueNumbers.push(iss.number);
}
}
})
core.info(`Actions: [query-issues]: [${JSON.stringify(issueNumbers)}]!`);
}
return issues;
};
async function getIssues (params, page = 1) {
let { data: issues } = await octokit.issues.listForRepo({
...params,
per_page: perPage,
page
});
if (issues.length >= perPage) {
issues = issues.concat(await getIssues(params, page + 1));
}
return issues;
};
async function getIssuesInMonth (owner, repo, thisMonth, page = 1) {
const month = getPreMonth(thisMonth);
let { data: issues } = await octokit.issues.listForRepo({
owner,
repo,
state: 'all',
per_page: perPage,
page
});
issues = issues.filter(i => {
return i.pull_request === undefined
});
if (issues.length && getCreatedMonth(issues[issues.length - 1].created_at) >= month) {
issues = issues.concat(await getIssuesInMonth(owner, repo, thisMonth, page + 1));
}
return issues;
};
// **************************************************************************
function getCreatedMonth (d) {
return dayjs(d).utc().month() + 1;
};
// **************************************************************************
module.exports = {
doQueryIssues,
getIssues,
getIssuesInMonth,
getCreatedMonth,
};

View File

@@ -1,4 +1,8 @@
function dealInput (para) { function dealInput (para) {
/**
* in 'x1,x2,x3'
* out ['x1','x2','x3']
*/
let arr = []; let arr = [];
if (para) { if (para) {
const paraArr = para.split(','); const paraArr = para.split(',');
@@ -11,11 +15,30 @@ function dealInput (para) {
return arr; return arr;
}; };
function matchKeyword(content, keywords) { function matchKeyword (content, keywords) {
return keywords.find(item => content.toLowerCase().includes(item)); return keywords.find(item => content.toLowerCase().includes(item));
}; };
function testDuplicate(body) {
if (!body || !body.startsWith('Duplicate of')) {
return false
}
let arr = body.split(' ');
if (arr[0] == 'Duplicate' && arr[1] == 'of') {
return true;
} else {
return false;
}
};
function getPreMonth (m) {
return m == 1 ? 12 : m -1;
};
module.exports = { module.exports = {
dealInput, dealInput,
getPreMonth,
matchKeyword, matchKeyword,
testDuplicate,
}; };

View File

@@ -1,16 +0,0 @@
{
"compilerOptions": {
"target": "esnext",
"moduleResolution": "node",
"baseUrl": "./",
"jsx": "preserve",
"declaration": true,
"skipLibCheck": true,
"esModuleInterop": true,
"paths": {
"@/*": ["src/*"],
"@@/*": ["src/.umi/*"],
"rc-dialog": ["src/index.ts"]
}
}
}

10672
yarn.lock Normal file

File diff suppressed because it is too large Load Diff