mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-19 18:25:58 +08:00
Merge pull request #67 from actions-cool/main
branch: merge main into 2.x
This commit is contained in:
17
.github/workflows/gh-pages.yml
vendored
17
.github/workflows/gh-pages.yml
vendored
@@ -1,17 +0,0 @@
|
||||
name: github pages
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: npm install
|
||||
- run: npm run docs:build
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./docs-dist
|
@@ -4,7 +4,7 @@ import { defineConfig } from 'dumi';
|
||||
const name = 'issues-helper';
|
||||
|
||||
export default defineConfig({
|
||||
title: 'Issue Helper',
|
||||
title: 'Issues Helper',
|
||||
mode: 'site',
|
||||
favicon: 'https://avatars1.githubusercontent.com/u/73879334?s=200&v=4',
|
||||
logo: 'https://avatars1.githubusercontent.com/u/73879334?s=200&v=4',
|
||||
|
20
CHANGELOG.md
20
CHANGELOG.md
@@ -1,3 +1,23 @@
|
||||
# Changelog
|
||||
|
||||
## v2.2.1
|
||||
|
||||
`2021.03.21`
|
||||
|
||||
- fix: list comment page lost in `find-comments`. [#66](https://github.com/actions-cool/issues-helper/pull/66)
|
||||
|
||||
## v2.2.0
|
||||
|
||||
`2021.03.21`
|
||||
|
||||
- feat: Added `title-excludes` parameter to `check-issue`. [#65](https://github.com/actions-cool/issues-helper/pull/65)
|
||||
|
||||
## v2.1.2
|
||||
|
||||
`2021.02.19`
|
||||
|
||||
- feat: update/delete comment support find-comments out. [#63](https://github.com/actions-cool/issues-helper/pull/63)
|
||||
|
||||
## v2.1.1
|
||||
|
||||
`2021.02.03`
|
||||
|
121
README.en-US.md
121
README.en-US.md
@@ -108,6 +108,14 @@ Please leave a message at [**here**](https://github.com/actions-cool/issues-help
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## ⚡ Feedback
|
||||
|
||||
You are very welcome to try it out and put forward your comments. You can use the following methods:
|
||||
|
||||
- Report bugs or consult with [Issue](https://github.com/actions-cool/issues-helper/issues)
|
||||
- Discuss via [Discussions](https://github.com/actions-cool/issues-helper/discussions)
|
||||
- Submit [Pull Request](https://github.com/actions-cool/issues-helper/pulls) to improve the code of `issues-helper`
|
||||
|
||||
## List
|
||||
|
||||
When the following list does not have the features you want, you can submit it in [What do you want?](https://github.com/actions-cool/issues-helper/discussions/18).
|
||||
@@ -162,7 +170,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Add assigness
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'add-assignees'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -204,7 +212,7 @@ jobs:
|
||||
if: contains(github.event.issue.body, 'xxx') == false
|
||||
steps:
|
||||
- name: Add labels
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'add-labels'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -229,7 +237,7 @@ Close the specified issue.
|
||||
|
||||
```yml
|
||||
- name: Close issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'close-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -262,7 +270,7 @@ jobs:
|
||||
if: github.event.label.name == 'xxx'
|
||||
steps:
|
||||
- name: Create comment
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -306,7 +314,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -339,7 +347,7 @@ Create label. If you want to maintain labels in batches, [see](https://github.co
|
||||
|
||||
```yml
|
||||
- name: Create label
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-label'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -367,7 +375,7 @@ According to [`comment-id`](#comment-id) delete the specified comment.
|
||||
|
||||
```yml
|
||||
- name: Delete comment
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'delete-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -379,6 +387,9 @@ According to [`comment-id`](#comment-id) delete the specified comment.
|
||||
| actions | Action type | string | ✔ |
|
||||
| token | [Token explain](#token) | string | ✔ |
|
||||
| comment-id | The comment ID | number | ✔ |
|
||||
| out-comments | The output of `find-comments`, if you find multiple, operate multiple | string | ✖ |
|
||||
|
||||
- When `out-comments` is entered, `comment-id` does not work
|
||||
|
||||
⏫ [Back to list](#List)
|
||||
|
||||
@@ -399,7 +410,7 @@ jobs:
|
||||
if: github.event.label.name == 'invalid'
|
||||
steps:
|
||||
- name: Lock issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'lock-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -433,7 +444,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: mark-duplicate
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'mark-duplicate'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -468,7 +479,7 @@ Open the specified issue.
|
||||
|
||||
```yml
|
||||
- name: Open issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'open-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -489,7 +500,7 @@ Remove the person designated by issue.
|
||||
|
||||
```yml
|
||||
- name: Remove assignees
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'remove-assignees'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -512,7 +523,7 @@ Remove the specified labels.
|
||||
|
||||
```yml
|
||||
- name: Remove labels
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'remove-labels'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -537,7 +548,7 @@ Replace the labels of issue.
|
||||
|
||||
```yml
|
||||
- name: Set labels
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'set-labels'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -560,7 +571,7 @@ Unlock the specified issue.
|
||||
|
||||
```yml
|
||||
- name: Unlock issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'unlock-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -593,7 +604,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Update comment
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'update-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -606,12 +617,14 @@ jobs:
|
||||
| actions | Action type | string | ✔ |
|
||||
| token | [Token explain](#token) | string | ✔ |
|
||||
| comment-id | The comment ID | number | ✔ |
|
||||
| out-comments | The output of `find-comments`, if you find multiple, operate multiple | string | ✖ |
|
||||
| body | Update the content of comment | string | ✖ |
|
||||
| update-mode | Update mode. Default `replace`, another `append` | string | ✖ |
|
||||
| contents | Add [reaction](#reactions-types) | string | ✖ |
|
||||
|
||||
- When `body` is not entered, it will remain as it is
|
||||
- When `update-mode` is `append`, additional operations will be performed. Anything other than `append` will be replaced. Only effective for `body`
|
||||
- When `out-comments` is entered, `comment-id` does not work
|
||||
|
||||
⏫ [Back to list](#List)
|
||||
|
||||
@@ -621,7 +634,7 @@ Update the specified issue according to the `issue-number`.
|
||||
|
||||
```yml
|
||||
- name: Update issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'update-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -671,7 +684,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: welcome
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'welcome'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -714,7 +727,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: check-inactive
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'check-inactive'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -767,7 +780,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: check-issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'check-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -783,6 +796,7 @@ jobs:
|
||||
| issue-number | The number of issue | number | ✔ |
|
||||
| assignee-includes | Assignees contains check | string | ✖ |
|
||||
| title-includes | Title contains check | string | ✖ |
|
||||
| title-excludes | Check whether the title is empty after removing the default title | string | ✖ |
|
||||
| body-includes | Body contains check | string | ✖ |
|
||||
|
||||
- `title-includes` `body-includes` supports the format `x1,x2` or `x1,x2/y1,y2`. Only supports two levels
|
||||
@@ -806,7 +820,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: close-issues
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'close-issues'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -840,7 +854,7 @@ Find the current warehouse issue No. 1, the creator is k and the content contain
|
||||
|
||||
```yml
|
||||
- name: Find comments
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'find-comments'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -888,7 +902,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: lock-issues
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'lock-issues'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -935,7 +949,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: month-statistics
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'month-statistics'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -963,13 +977,15 @@ Flexible reference.
|
||||
|
||||
### `find-comments + create-comment + update-comment`
|
||||
|
||||
Hypothetical scenario: When the issue modification of the `watch` label is added, find out whether there is a comment containing `error` created by k, if there is only one, update the comment, if not, add a new comment.
|
||||
Hypothetical scenario: When the issue modification of the `watch` label is added, find out whether there is a comment created by k that contains `<!-- Created by actions-cool/issues-helper -->`, if so, update the comment, If not, add a comment.
|
||||
|
||||
Of course, if you need such a scene, you can directly use [**Maintain One Comment**](https://github.com/actions-cool/maintain-one-comment).
|
||||
|
||||
```yml
|
||||
name: Test
|
||||
|
||||
on:
|
||||
isssue:
|
||||
issues:
|
||||
types: [edited]
|
||||
|
||||
jobs:
|
||||
@@ -978,32 +994,40 @@ jobs:
|
||||
if: github.event.label.name == 'watch'
|
||||
steps:
|
||||
- name: find comments
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
id: fcid
|
||||
with:
|
||||
actions: 'find-comments'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-number: ${{ github.event.issue.number }}
|
||||
comment-auth: k
|
||||
body-includes: 'error'
|
||||
body-includes: '<!-- Created by actions-cool/issues-helper -->'
|
||||
|
||||
# Output view found content. GitHub default outputs are strings
|
||||
- run: echo find-comments ${{ steps.fcid.outputs.comments }}
|
||||
shell: bash
|
||||
|
||||
- name: create comment
|
||||
if: ${{ steps.fcid.outputs.comments.length == 0 }}
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
if: contains(steps.fcid.outputs.comments, '<!-- Created by actions-cool/issues-helper -->') == false
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-number: ${{ github.event.issue.number }}
|
||||
body: 'Some error!'
|
||||
body: |
|
||||
Error
|
||||
<!-- Created by actions-cool/issues-helper -->
|
||||
|
||||
- name: update comment
|
||||
if: ${{ steps.fcid.outputs.comments.length == 1 }}
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
if: contains(steps.fcid.outputs.comments, '<!-- Created by actions-cool/issues-helper -->') == true
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'update-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment-id: ${{ steps.fcid.outputs.comments[0].id }}
|
||||
body: 'Some error again!'
|
||||
out-comments: ${{ steps.fcid.outputs.comments }}
|
||||
body: |
|
||||
Error Again
|
||||
<!-- Created by actions-cool/issues-helper -->
|
||||
update-mode: 'append'
|
||||
```
|
||||
|
||||
@@ -1022,7 +1046,14 @@ Need to have the person token with push permission.
|
||||
- `Name` is the same as in actions
|
||||
- `Value` fill in the token just applied by the individual
|
||||
|
||||
When the token is not filled in actions or the corresponding secrets are not added to the project, it will default to github-actions <kbd>bot</kbd>. [More](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow).
|
||||
When the token is not filled in actions or input `${{ secrets.GITHUB_TOKEN }}`, it will default to `github-actions-bot`. [More](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow).
|
||||
|
||||
⏫ [Back to list](#List)
|
||||
|
||||
### GitHub Docs
|
||||
|
||||
- [Workflow syntax for GitHub Actions](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#on)
|
||||
- [Events that trigger workflows](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows)
|
||||
|
||||
⏫ [Back to list](#List)
|
||||
|
||||
@@ -1030,7 +1061,7 @@ When the token is not filled in actions or the corresponding secrets are not add
|
||||
|
||||
```yml
|
||||
- name: Create issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
id: createissue
|
||||
with:
|
||||
actions: 'create-issue'
|
||||
@@ -1039,12 +1070,10 @@ When the token is not filled in actions or the corresponding secrets are not add
|
||||
run: echo "Outputs issue_number is ${{ steps.createissue.outputs.issue-number }}"
|
||||
```
|
||||
|
||||
[More](https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs).
|
||||
More:
|
||||
|
||||
### GitHub Docs
|
||||
|
||||
- [Workflow syntax for GitHub Actions](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#on)
|
||||
- [Events that trigger workflows](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows)
|
||||
1. https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs
|
||||
2. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs
|
||||
|
||||
⏫ [Back to list](#List)
|
||||
|
||||
@@ -1123,20 +1152,14 @@ Click the `···` icon in the upper right corner of a comment, select `Copy lin
|
||||
uses: actions-cool/issues-helper@1.x
|
||||
```
|
||||
|
||||
- v2 [upgrade reference](https://github.com/actions-cool/issues-helper/blob/fix/docs/guide/faq.en-US.md#what-should-i-pay-attention-to-when-upgrading-from-v1x-to-v2)
|
||||
|
||||
## Actions Template
|
||||
|
||||
- You can directly use this [GitHub Actions workflow template](https://github.com/actions-cool/.github) repositorie template
|
||||
- Personal exercises and tests [Actions](https://github.com/actions-cool/test-issues-helper) repository
|
||||
- Can also refer to the warehouse of [online users](#who-is-using)
|
||||
|
||||
## ⚡ Feedback
|
||||
|
||||
You are very welcome to try it out and put forward your comments. You can use the following methods:
|
||||
|
||||
- Report bugs or consult with [Issue](https://github.com/actions-cool/issues-helper/issues)
|
||||
- Discuss via [Discussions](https://github.com/actions-cool/issues-helper/discussions)
|
||||
- Submit [Pull Request](https://github.com/actions-cool/issues-helper/pulls) to improve the code of `issues-helper`
|
||||
|
||||
## LICENSE
|
||||
|
||||
[MIT](https://github.com/actions-cool/issues-helper/blob/main/LICENSE)
|
||||
|
125
README.md
125
README.md
@@ -108,6 +108,18 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## ⚡ 反馈
|
||||
|
||||
非常欢迎你来尝试使用,并提出意见,你可以通过以下方式:
|
||||
|
||||
- 通过 [Issue](https://github.com/actions-cool/issues-helper/issues) 报告 bug 或进行咨询
|
||||
- 通过 [Discussions](https://github.com/actions-cool/issues-helper/discussions) 进行讨论
|
||||
- 提交 [Pull Request](https://github.com/actions-cool/issues-helper/pulls) 改进 `issues-helper` 的代码
|
||||
|
||||
也欢迎加入 钉钉交流群
|
||||
|
||||

|
||||
|
||||
## 列 表
|
||||
|
||||
当以下列表没有你想要的功能时,可以在 [What do you want?](https://github.com/actions-cool/issues-helper/discussions/18) 中提出。
|
||||
@@ -162,7 +174,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Add assigness
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'add-assignees'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -204,7 +216,7 @@ jobs:
|
||||
if: contains(github.event.issue.body, 'xxx') == false
|
||||
steps:
|
||||
- name: Add labels
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'add-labels'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -229,7 +241,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Close issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'close-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -262,7 +274,7 @@ jobs:
|
||||
if: github.event.label.name == 'xxx'
|
||||
steps:
|
||||
- name: Create comment
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -306,7 +318,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -339,7 +351,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Create label
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-label'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -367,7 +379,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Delete comment
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'delete-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -379,6 +391,9 @@ jobs:
|
||||
| actions | 操作类型 | string | ✔ |
|
||||
| token | [token 说明](#token) | string | ✔ |
|
||||
| comment-id | 指定的 comment | number | ✔ |
|
||||
| out-comments | `find-comments` 的输出,若查找多个,则操作多个 | string | ✖ |
|
||||
|
||||
- 当 `out-comments` 输入时,`comment-id` 不起作用
|
||||
|
||||
⏫ [返回列表](#列-表)
|
||||
|
||||
@@ -399,7 +414,7 @@ jobs:
|
||||
if: github.event.label.name == 'invalid'
|
||||
steps:
|
||||
- name: Lock issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'lock-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -433,7 +448,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: mark-duplicate
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'mark-duplicate'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -468,7 +483,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Open issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'open-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -489,7 +504,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Remove assignees
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'remove-assignees'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -512,7 +527,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Remove labels
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'remove-labels'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -537,7 +552,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Set labels
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'set-labels'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -560,7 +575,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Unlock issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'unlock-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -593,7 +608,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Update comment
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'update-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -606,12 +621,14 @@ jobs:
|
||||
| actions | 操作类型 | string | ✔ |
|
||||
| token | [token 说明](#token) | string | ✔ |
|
||||
| comment-id | 指定的 comment | number | ✔ |
|
||||
| out-comments | `find-comments` 的输出,若查找多个,则操作多个 | string | ✖ |
|
||||
| body | 更新 comment 的内容 | string | ✖ |
|
||||
| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ |
|
||||
| contents | 增加 [reaction](#reactions-types) | string | ✖ |
|
||||
|
||||
- `body` 不填时,会保持原有
|
||||
- `update-mode` 为 `append` 时,会进行附加操作。非 `append` 都会进行替换。仅对 `body` 生效
|
||||
- 当 `out-comments` 输入时,`comment-id` 不起作用
|
||||
|
||||
⏫ [返回列表](#列-表)
|
||||
|
||||
@@ -621,7 +638,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Update issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'update-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -669,7 +686,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: welcome
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'welcome'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -712,7 +729,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: check-inactive
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'check-inactive'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -761,7 +778,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: check-issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'check-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -777,6 +794,7 @@ jobs:
|
||||
| issue-number | 指定的 issue | number | ✔ |
|
||||
| assignee-includes | 是否包含指定人 | string | ✖ |
|
||||
| title-includes | 标题包含校验 | string | ✖ |
|
||||
| title-excludes | 检测标题移除默认 title 后是否为空 | string | ✖ |
|
||||
| body-includes | 内容包含校验 | string | ✖ |
|
||||
|
||||
- `title-includes` `body-includes` 支持格式 `x1,x2` 或者 `x1,x2/y1,y2`。只支持两个层级
|
||||
@@ -800,7 +818,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: close-issues
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'close-issues'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -834,7 +852,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Find comments
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'find-comments'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -882,7 +900,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: lock-issues
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'lock-issues'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -929,7 +947,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: month-statistics
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'month-statistics'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -957,13 +975,15 @@ jobs:
|
||||
|
||||
### `find-comments + create-comment + update-comment`
|
||||
|
||||
假设场景:当添加了 `watch` label 的 issue 修改时,查找是否有 k 创建的包含 `error` 的评论,如果只有一个,则更新该 comment,如果没有,则新增一个 comment。
|
||||
假设场景:当添加了 `watch` label 的 issue 修改时,查找是否有 k 创建的包含 `<!-- Created by actions-cool/issues-helper -->` 的评论,如果有,则更新 comment,如果没有,则新增一个 comment。
|
||||
|
||||
当然,如果你需要这样的场景,可以直接使用 [**Maintain One Comment**](https://github.com/actions-cool/maintain-one-comment)。
|
||||
|
||||
```yml
|
||||
name: Test
|
||||
|
||||
on:
|
||||
isssue:
|
||||
issues:
|
||||
types: [edited]
|
||||
|
||||
jobs:
|
||||
@@ -972,32 +992,40 @@ jobs:
|
||||
if: github.event.label.name == 'watch'
|
||||
steps:
|
||||
- name: find comments
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
id: fcid
|
||||
with:
|
||||
actions: 'find-comments'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-number: ${{ github.event.issue.number }}
|
||||
comment-auth: k
|
||||
body-includes: 'error'
|
||||
body-includes: '<!-- Created by actions-cool/issues-helper -->'
|
||||
|
||||
# 输出查看找到的内容。GitHub 默认 outputs 为字符串
|
||||
- run: echo find-comments ${{ steps.fcid.outputs.comments }}
|
||||
shell: bash
|
||||
|
||||
- name: create comment
|
||||
if: ${{ steps.fcid.outputs.comments.length == 0 }}
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
if: contains(steps.fcid.outputs.comments, '<!-- Created by actions-cool/issues-helper -->') == false
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-number: ${{ github.event.issue.number }}
|
||||
body: 'Some error!'
|
||||
body: |
|
||||
Error
|
||||
<!-- Created by actions-cool/issues-helper -->
|
||||
|
||||
- name: update comment
|
||||
if: ${{ steps.fcid.outputs.comments.length == 1 }}
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
if: contains(steps.fcid.outputs.comments, '<!-- Created by actions-cool/issues-helper -->') == true
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'update-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment-id: ${{ steps.fcid.outputs.comments[0].id }}
|
||||
body: 'Some error again!'
|
||||
out-comments: ${{ steps.fcid.outputs.comments }}
|
||||
body: |
|
||||
Error Again
|
||||
<!-- Created by actions-cool/issues-helper -->
|
||||
update-mode: 'append'
|
||||
```
|
||||
|
||||
@@ -1016,7 +1044,14 @@ jobs:
|
||||
- `Name` 与 actions 中保持一致
|
||||
- `Value` 填写刚才个人申请的 token
|
||||
|
||||
当 actions 不填写 token 时,或项目未添加对应 secrets 时,会默认为 github-actions <kbd>bot</kbd>。[更多查看](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow)。
|
||||
当 actions 不填写 token 时,或填写 `${{ secrets.GITHUB_TOKEN }}`,会默认为 `github-actions-bot`。[更多查看](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow)。
|
||||
|
||||
⏫ [返回列表](#列-表)
|
||||
|
||||
### GitHub Docs
|
||||
|
||||
- [GitHub Actions 语法](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#on)
|
||||
- [工作流触发机制](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows)
|
||||
|
||||
⏫ [返回列表](#列-表)
|
||||
|
||||
@@ -1024,7 +1059,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Create issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
id: createissue
|
||||
with:
|
||||
actions: 'create-issue'
|
||||
@@ -1033,12 +1068,10 @@ jobs:
|
||||
run: echo "Outputs issue_number is ${{ steps.createissue.outputs.issue-number }}"
|
||||
```
|
||||
|
||||
[更多查看](https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs)。
|
||||
更多查看:
|
||||
|
||||
### GitHub Docs
|
||||
|
||||
- [GitHub Actions 语法](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#on)
|
||||
- [工作流触发机制](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows)
|
||||
1. https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs
|
||||
2. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs
|
||||
|
||||
⏫ [返回列表](#列-表)
|
||||
|
||||
@@ -1118,20 +1151,14 @@ x2 + y2
|
||||
uses: actions-cool/issues-helper@1.x
|
||||
```
|
||||
|
||||
- v2 [升级参考](https://github.com/actions-cool/issues-helper/blob/fix/docs/guide/faq.md#%E4%BB%8E-v1x-%E5%8D%87%E7%BA%A7%E5%88%B0-v2%E6%9C%89%E4%BB%80%E4%B9%88%E6%B3%A8%E6%84%8F%E7%9A%84%E5%9C%B0%E6%96%B9%E5%90%97)
|
||||
|
||||
## Actions 模板
|
||||
|
||||
- 可直接使用这个 [GitHub Actions workflow template](https://github.com/actions-cool/.github) 仓库的模板
|
||||
- 个人练习和测试 [Actions](https://github.com/actions-cool/test-issues-helper) 的仓库
|
||||
- 也可以来 [线上使用者](#谁在使用) 的仓库参照
|
||||
|
||||
## ⚡ 反馈
|
||||
|
||||
非常欢迎你来尝试使用,并提出意见,你可以通过以下方式:
|
||||
|
||||
- 通过 [Issue](https://github.com/actions-cool/issues-helper/issues) 报告 bug 或进行咨询
|
||||
- 通过 [Discussions](https://github.com/actions-cool/issues-helper/discussions) 进行讨论
|
||||
- 提交 [Pull Request](https://github.com/actions-cool/issues-helper/pulls) 改进 `issues-helper` 的代码
|
||||
|
||||
## LICENSE
|
||||
|
||||
[MIT](https://github.com/actions-cool/issues-helper/blob/main/LICENSE)
|
||||
|
12
action.yml
12
action.yml
@@ -1,9 +1,12 @@
|
||||
name: 'Issues Helper'
|
||||
description: 'A GitHub Action that easily helps you automatically manage issues'
|
||||
author: 'xrkffgg'
|
||||
|
||||
# https://actions-cool.github.io/github-action-branding/
|
||||
branding:
|
||||
icon: 'message-square'
|
||||
color: 'black'
|
||||
|
||||
inputs:
|
||||
actions:
|
||||
description: 'Action name'
|
||||
@@ -40,12 +43,19 @@ inputs:
|
||||
description: 'Issue reactions emoji'
|
||||
direction:
|
||||
description: 'Find comments direction'
|
||||
|
||||
# comments
|
||||
comment-auth:
|
||||
description: 'Find comments query auth'
|
||||
out-comments:
|
||||
description: 'Find comments out comments'
|
||||
assignee-includes:
|
||||
description: 'Check use'
|
||||
body-includes:
|
||||
description: 'Query use'
|
||||
# check
|
||||
title-excludes:
|
||||
description: 'Remove some to check title whether empty.'
|
||||
title-includes:
|
||||
description: 'Query use'
|
||||
issue-creator:
|
||||
@@ -78,6 +88,7 @@ inputs:
|
||||
description: 'For month-statistics'
|
||||
count-comments:
|
||||
description: 'For month-statistics'
|
||||
|
||||
outputs:
|
||||
issue-number:
|
||||
description: 'Create Issue Number'
|
||||
@@ -87,6 +98,7 @@ outputs:
|
||||
description: 'Find comments'
|
||||
check-result:
|
||||
description: 'Check issue'
|
||||
|
||||
runs:
|
||||
using: node12
|
||||
main: 'dist/index.js'
|
||||
|
392
dist/index.js
vendored
392
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -22,7 +22,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: check-inactive
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'check-inactive'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -73,7 +73,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: check-issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'check-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -89,6 +89,7 @@ jobs:
|
||||
| issue-number | The number of issue | number | ✔ |
|
||||
| assignee-includes | Assignees contains check | string | ✖ |
|
||||
| title-includes | Title contains check | string | ✖ |
|
||||
| title-excludes | Check whether the title is empty after removing the default title | string | ✖ |
|
||||
| body-includes | Body contains check | string | ✖ |
|
||||
|
||||
- `title-includes` `body-includes` supports the format `x1,x2` or `x1,x2/y1,y2`. Only supports two levels
|
||||
@@ -110,7 +111,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: close-issues
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'close-issues'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -142,7 +143,7 @@ Find the current warehouse issue No. 1, the creator is k and the content contain
|
||||
|
||||
```yml
|
||||
- name: Find comments
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'find-comments'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -188,7 +189,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: lock-issues
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'lock-issues'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -233,7 +234,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: month-statistics
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'month-statistics'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
@@ -22,7 +22,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: check-inactive
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'check-inactive'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -69,7 +69,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: check-issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'check-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -85,6 +85,7 @@ jobs:
|
||||
| issue-number | 指定的 issue | number | ✔ |
|
||||
| assignee-includes | 是否包含指定人 | string | ✖ |
|
||||
| title-includes | 标题包含校验 | string | ✖ |
|
||||
| title-excludes | 检测标题移除默认 title 后是否为空 | string | ✖ |
|
||||
| body-includes | 内容包含校验 | string | ✖ |
|
||||
|
||||
- `title-includes` `body-includes` 支持格式 `x1,x2` 或者 `x1,x2/y1,y2`。只支持两个层级
|
||||
@@ -106,7 +107,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: close-issues
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'close-issues'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -138,7 +139,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Find comments
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'find-comments'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -184,7 +185,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: lock-issues
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'lock-issues'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -229,7 +230,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: month-statistics
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'month-statistics'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
@@ -22,7 +22,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Add assigness
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'add-assignees'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
if: contains(github.event.issue.body, 'xxx') == false
|
||||
steps:
|
||||
- name: Add labels
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'add-labels'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -85,7 +85,7 @@ Close the specified issue.
|
||||
|
||||
```yml
|
||||
- name: Close issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'close-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
if: github.event.label.name == 'xxx'
|
||||
steps:
|
||||
- name: Create comment
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -158,7 +158,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -189,7 +189,7 @@ Create label. If you want to maintain labels in batches, [see](https://github.co
|
||||
|
||||
```yml
|
||||
- name: Create label
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-label'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -215,7 +215,7 @@ According to [`comment-id`](/en-US/guide/ref#-comment-id) delete the specified c
|
||||
|
||||
```yml
|
||||
- name: Delete comment
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'delete-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -227,6 +227,9 @@ According to [`comment-id`](/en-US/guide/ref#-comment-id) delete the specified c
|
||||
| actions | Action type | string | ✔ |
|
||||
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
|
||||
| comment-id | The comment ID | number | ✔ |
|
||||
| out-comments | The output of `find-comments`, if you find multiple, operate multiple | string | ✖ |
|
||||
|
||||
- When `out-comments` is entered, `comment-id` does not work
|
||||
|
||||
## `lock-issue`
|
||||
|
||||
@@ -245,7 +248,7 @@ jobs:
|
||||
if: github.event.label.name == 'invalid'
|
||||
steps:
|
||||
- name: Lock issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'lock-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -277,7 +280,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: mark-duplicate
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'mark-duplicate'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -316,7 +319,7 @@ Open the specified issue.
|
||||
|
||||
```yml
|
||||
- name: Open issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'open-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -335,7 +338,7 @@ Remove the person designated by issue.
|
||||
|
||||
```yml
|
||||
- name: Remove assignees
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'remove-assignees'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -356,7 +359,7 @@ Remove the specified labels.
|
||||
|
||||
```yml
|
||||
- name: Remove labels
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'remove-labels'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -379,7 +382,7 @@ Replace the labels of issue.
|
||||
|
||||
```yml
|
||||
- name: Set labels
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'set-labels'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -400,7 +403,7 @@ Unlock the specified issue.
|
||||
|
||||
```yml
|
||||
- name: Unlock issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'unlock-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -431,7 +434,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Update comment
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'update-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -444,12 +447,14 @@ jobs:
|
||||
| actions | Action type | string | ✔ |
|
||||
| token | [Token explain](/en-US/guide/ref#-token) | string | ✔ |
|
||||
| comment-id | The comment ID | number | ✔ |
|
||||
| out-comments | The output of `find-comments`, if you find multiple, operate multiple | string | ✖ |
|
||||
| body | Update the content of comment | string | ✖ |
|
||||
| update-mode | Update mode. Default `replace`, another `append` | string | ✖ |
|
||||
| contents | Add [reaction](/en-US/guide/ref#-reactions-type) | string | ✖ |
|
||||
|
||||
- When `body` is not entered, it will remain as it is
|
||||
- When `update-mode` is `append`, additional operations will be performed. Anything other than `append` will be replaced. Only effective for `body`
|
||||
- When `out-comments` is entered, `comment-id` does not work
|
||||
|
||||
## `update-issue`
|
||||
|
||||
@@ -457,7 +462,7 @@ Update the specified issue according to the `issue-number`.
|
||||
|
||||
```yml
|
||||
- name: Update issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'update-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -505,7 +510,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: welcome
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'welcome'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
39
docs/base.md
39
docs/base.md
@@ -22,7 +22,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Add assigness
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'add-assignees'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
if: contains(github.event.issue.body, 'xxx') == false
|
||||
steps:
|
||||
- name: Add labels
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'add-labels'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -85,7 +85,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Close issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'close-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
if: github.event.label.name == 'xxx'
|
||||
steps:
|
||||
- name: Create comment
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -158,7 +158,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -189,7 +189,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Create label
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-label'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -215,7 +215,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Delete comment
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'delete-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -227,6 +227,9 @@ jobs:
|
||||
| actions | 操作类型 | string | ✔ |
|
||||
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
|
||||
| comment-id | 指定的 comment | number | ✔ |
|
||||
| out-comments | `find-comments` 的输出,若查找多个,则操作多个 | string | ✖ |
|
||||
|
||||
- 当 `out-comments` 输入时,`comment-id` 不起作用
|
||||
|
||||
## `lock-issue`
|
||||
|
||||
@@ -245,7 +248,7 @@ jobs:
|
||||
if: github.event.label.name == 'invalid'
|
||||
steps:
|
||||
- name: Lock issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'lock-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -277,7 +280,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: mark-duplicate
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'mark-duplicate'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -316,7 +319,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Open issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'open-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -335,7 +338,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Remove assignees
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'remove-assignees'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -356,7 +359,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Remove labels
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'remove-labels'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -379,7 +382,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Set labels
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'set-labels'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -400,7 +403,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Unlock issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'unlock-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -431,7 +434,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Update comment
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'update-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -444,12 +447,14 @@ jobs:
|
||||
| actions | 操作类型 | string | ✔ |
|
||||
| token | [token 说明](/guide/ref#-token-说明) | string | ✔ |
|
||||
| comment-id | 指定的 comment | number | ✔ |
|
||||
| out-comments | `find-comments` 的输出,若查找多个,则操作多个 | string | ✖ |
|
||||
| body | 更新 comment 的内容 | string | ✖ |
|
||||
| update-mode | 更新模式。默认 `replace` 替换,`append` 附加 | string | ✖ |
|
||||
| contents | 增加 [reaction](/guide/ref#-reactions-类型) | string | ✖ |
|
||||
|
||||
- `body` 不填时,会保持原有
|
||||
- `update-mode` 为 `append` 时,会进行附加操作。非 `append` 都会进行替换。仅对 `body` 生效
|
||||
- 当 `out-comments` 输入时,`comment-id` 不起作用
|
||||
|
||||
## `update-issue`
|
||||
|
||||
@@ -457,7 +462,7 @@ jobs:
|
||||
|
||||
```yml
|
||||
- name: Update issue
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'update-issue'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -504,7 +509,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: welcome
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'welcome'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
@@ -27,4 +27,6 @@ toc: menu
|
||||
uses: actions-cool/issues-helper@1.x
|
||||
```
|
||||
|
||||
- v2 [upgrade reference](/en-US/guide/faq)
|
||||
|
||||
<embed src="../CHANGELOG.md"></embed>
|
||||
|
@@ -27,4 +27,6 @@ toc: menu
|
||||
uses: actions-cool/issues-helper@1.x
|
||||
```
|
||||
|
||||
- v2 [升级参考](/guide/faq)
|
||||
|
||||
<embed src="../CHANGELOG.md"></embed>
|
||||
|
@@ -28,7 +28,7 @@ with:
|
||||
|
||||
- `count-lables`: Regardless of setting `true` or `'ture'`, all received in the program is in string format
|
||||
|
||||
At the same time, the output is also in string format
|
||||
At the same time, the output is also in string format. [See](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs).
|
||||
|
||||
- `check-result`: The judgment condition is `if: steps.xxid.outputs.check-result =='true'`
|
||||
|
||||
|
@@ -29,7 +29,7 @@ with:
|
||||
|
||||
- `count-lables`:不管设置 `true` 还是 `'ture'`,在程序里接收到的都是字符串格式
|
||||
|
||||
同时输出的也是字符串格式
|
||||
同时输出的也是字符串格式。[参看](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs)。
|
||||
|
||||
- `check-result`:判断条件为 `if: steps.xxid.outputs.check-result == 'true'`
|
||||
|
||||
|
@@ -13,7 +13,7 @@ Need to have the person token with push permission.
|
||||
- `Name` is the same as in actions
|
||||
- `Value` fill in the token just applied by the individual
|
||||
|
||||
When the token is not filled in actions or the corresponding secrets are not added to the project, it will default to `github-actions-bot`. [More](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow).
|
||||
When the token is not filled in actions or input `${{ secrets.GITHUB_TOKEN }}`, it will default to `github-actions-bot`. [More](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow).
|
||||
|
||||
## 📍 GitHub Docs
|
||||
|
||||
@@ -33,7 +33,10 @@ When the token is not filled in actions or the corresponding secrets are not add
|
||||
run: echo "Outputs issue_number is ${{ steps.createissue.outputs.issue-number }}"
|
||||
```
|
||||
|
||||
[More](https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs).
|
||||
More:
|
||||
|
||||
1. https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs
|
||||
2. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs
|
||||
|
||||
## 📍 `includes` check rules
|
||||
|
||||
|
@@ -13,7 +13,7 @@ toc: menu
|
||||
- `Name` 与 actions 中保持一致
|
||||
- `Value` 填写刚才个人申请的 token
|
||||
|
||||
当 actions 不填写 token 时,或项目未添加对应 secrets 时,会默认为 `github-actions-bot`。[更多查看](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow)。
|
||||
当 actions 不填写 token 时,或输入 `${{ secrets.GITHUB_TOKEN }}`,会默认为 `github-actions-bot`。[更多查看](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow)。
|
||||
|
||||
## 📍 GitHub 相关文档
|
||||
|
||||
@@ -33,7 +33,10 @@ toc: menu
|
||||
run: echo "Outputs issue_number is ${{ steps.createissue.outputs.issue-number }}"
|
||||
```
|
||||
|
||||
[更多查看](https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs)。
|
||||
更多查看:
|
||||
|
||||
1. https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#outputs
|
||||
2. https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs
|
||||
|
||||
## 📍 `includes` 校验规则
|
||||
|
||||
|
@@ -38,7 +38,7 @@ jobs:
|
||||
steps:
|
||||
- name: help wanted
|
||||
if: github.event.label.name == 'help wanted'
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
@@ -38,7 +38,7 @@ jobs:
|
||||
steps:
|
||||
- name: help wanted
|
||||
if: github.event.label.name == 'help wanted'
|
||||
uses: actions-cool/issues-helper@v2.1.1
|
||||
uses: actions-cool/issues-helper@v2.2.1
|
||||
with:
|
||||
actions: 'create-comment'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -60,3 +60,7 @@ jobs:
|
||||
- 通过 [Issue](https://github.com/actions-cool/issues-helper/issues) 报告 bug 或进行咨询
|
||||
- 通过 [Discussions](https://github.com/actions-cool/issues-helper/discussions) 进行讨论
|
||||
- 提交 [Pull Request](https://github.com/actions-cool/issues-helper/pulls) 改进 `issues-helper` 的代码
|
||||
|
||||
也欢迎加入 钉钉交流群
|
||||
|
||||

|
||||
|
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "issues-helper",
|
||||
"version": "2.1.1",
|
||||
"version": "2.2.1",
|
||||
"private": true,
|
||||
"description": "Some operations on issue.",
|
||||
"description": "A GitHub Action easily helps you automatically manage issues.",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
"start": "dumi dev",
|
||||
@@ -42,7 +42,7 @@
|
||||
"@vercel/ncc": "^0.25.1",
|
||||
"common-tags": "^1.8.0",
|
||||
"dotenv": "^8.2.0",
|
||||
"dumi": "^1.1.1",
|
||||
"dumi": "1.1.7",
|
||||
"gh-pages": "^3.1.0",
|
||||
"react": "^17.0.1"
|
||||
}
|
||||
|
@@ -1,7 +1,9 @@
|
||||
const { readFileSync, writeFileSync } = require('fs');
|
||||
|
||||
const last = /v2\.1\.1/g;
|
||||
const now = 'v2.2.0';
|
||||
const { version } = JSON.parse(readFileSync('./package.json', 'utf-8'));
|
||||
|
||||
const last = /v2\.2\.0/g;
|
||||
const now = `v${version}`;
|
||||
|
||||
let readme = readFileSync('./README.md', 'utf-8');
|
||||
readme = readme.replace(last, now);
|
||||
|
@@ -28,6 +28,7 @@ direction = direction === 'desc' ? 'desc' : 'asc';
|
||||
const commentAuth = core.getInput('comment-auth');
|
||||
const bodyIncludes = core.getInput('body-includes');
|
||||
const titleIncludes = core.getInput('title-includes');
|
||||
const titleRemove = core.getInput('title-excludes');
|
||||
const assigneeIncludes = core.getInput('assignee-includes');
|
||||
|
||||
let issueState = core.getInput('issue-state') || 'open';
|
||||
@@ -67,7 +68,7 @@ async function doCheckInactive(owner, repo, labels) {
|
||||
* 关键字匹配,是否包含前一个某个+后一个某个 '官网,网站/挂了,无法访问'
|
||||
*/
|
||||
async function doCheckIssue(owner, repo, issueNumber) {
|
||||
var checkResult = true;
|
||||
let checkResult = true;
|
||||
const issue = await octokit.issues.get({
|
||||
owner,
|
||||
repo,
|
||||
@@ -86,6 +87,17 @@ async function doCheckIssue(owner, repo, issueNumber) {
|
||||
!checkAssignee ? (checkResult = false) : null;
|
||||
}
|
||||
|
||||
if (!!checkResult && titleRemove) {
|
||||
const removes = dealStringToArr(titleRemove);
|
||||
let t = issue.data.title;
|
||||
removes.forEach(re => {
|
||||
t = t.replace(re, '');
|
||||
});
|
||||
if (t.trim().length == 0) {
|
||||
checkResult = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!!checkResult && titleIncludes) {
|
||||
const titleArr = titleIncludes.split('/');
|
||||
const keyword1 = dealStringToArr(titleArr[0]);
|
||||
@@ -123,14 +135,10 @@ async function doCloseIssues(owner, repo, labels) {
|
||||
}
|
||||
|
||||
async function doFindComments(owner, repo, issueNumber) {
|
||||
const res = await octokit.issues.listComments({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: issueNumber,
|
||||
});
|
||||
const commentList = await listComments(owner, repo, issueNumber);
|
||||
core.info(`Actions: [find-comments][${issueNumber}] success!`);
|
||||
let comments = [];
|
||||
res.data.forEach(item => {
|
||||
commentList.forEach(item => {
|
||||
const a = commentAuth ? item.user.login === commentAuth : true;
|
||||
const b = bodyIncludes ? item.body.includes(bodyIncludes) : true;
|
||||
if (a && b) {
|
||||
@@ -147,6 +155,21 @@ async function doFindComments(owner, repo, issueNumber) {
|
||||
}
|
||||
});
|
||||
core.setOutput('comments', comments);
|
||||
core.info(`out-comments: ${JSON.stringify(comments)}`);
|
||||
}
|
||||
|
||||
async function listComments(owner, repo, issueNumber, page = 1) {
|
||||
let { data: comments } = await octokit.issues.listComments({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: issueNumber,
|
||||
per_page: 100,
|
||||
page,
|
||||
});
|
||||
if (comments.length >= 100) {
|
||||
comments = comments.concat(await listComments(page + 1));
|
||||
}
|
||||
return comments;
|
||||
}
|
||||
|
||||
async function doLockIssues(owner, repo, labels) {
|
||||
@@ -208,9 +231,7 @@ async function doMonthStatistics(owner, repo, labels, assignees) {
|
||||
});
|
||||
}
|
||||
}
|
||||
let now = dayjs()
|
||||
.utc()
|
||||
.format('YYYY-MM-DD HH:mm:ss');
|
||||
let now = dayjs().utc().format('YYYY-MM-DD HH:mm:ss');
|
||||
let body = `
|
||||
- Created time: ${now}
|
||||
|
||||
|
88
src/base.js
88
src/base.js
@@ -147,12 +147,27 @@ async function doCreateLabel(owner, repo) {
|
||||
}
|
||||
|
||||
async function doDeleteComment(owner, repo, commentId) {
|
||||
await octokit.issues.deleteComment({
|
||||
owner,
|
||||
repo,
|
||||
comment_id: commentId,
|
||||
});
|
||||
core.info(`Actions: [delete-comment][${commentId}] success!`);
|
||||
let id = commentId;
|
||||
|
||||
const outComments = core.getInput('out-comments');
|
||||
if (outComments) {
|
||||
const outCommentsArr = JSON.parse(outComments);
|
||||
core.info(`Actions: [out-comments-length][${outCommentsArr.length}] success!`);
|
||||
outCommentsArr.forEach(async item => {
|
||||
await doDelet(item.id);
|
||||
});
|
||||
} else {
|
||||
await doDelet(id);
|
||||
}
|
||||
|
||||
async function doDelet(id) {
|
||||
await octokit.issues.deleteComment({
|
||||
owner,
|
||||
repo,
|
||||
comment_id: id,
|
||||
});
|
||||
core.info(`Actions: [delete-comment][${id}] success!`);
|
||||
}
|
||||
}
|
||||
|
||||
async function doLockIssue(owner, repo, issueNumber) {
|
||||
@@ -330,32 +345,47 @@ async function doUnlockIssue(owner, repo, issueNumber) {
|
||||
}
|
||||
|
||||
async function doUpdateComment(owner, repo, commentId, body, updateMode, ifUpdateBody) {
|
||||
const comment = await octokit.issues.getComment({
|
||||
owner,
|
||||
repo,
|
||||
comment_id: commentId,
|
||||
});
|
||||
const comment_body = comment.data.body;
|
||||
let id = commentId;
|
||||
|
||||
let params = {
|
||||
owner,
|
||||
repo,
|
||||
comment_id: commentId,
|
||||
};
|
||||
|
||||
if (core.getInput('body') || ifUpdateBody) {
|
||||
if (updateMode === 'append') {
|
||||
params.body = `${comment_body}\n${body}`;
|
||||
} else {
|
||||
params.body = body;
|
||||
}
|
||||
|
||||
await octokit.issues.updateComment(params);
|
||||
core.info(`Actions: [update-comment][${commentId}] success!`);
|
||||
const outComments = core.getInput('out-comments');
|
||||
if (outComments) {
|
||||
const outCommentsArr = JSON.parse(outComments);
|
||||
core.info(`Actions: [out-comments-length][${outCommentsArr.length}] success!`);
|
||||
outCommentsArr.forEach(async item => {
|
||||
await doComment(item.id);
|
||||
});
|
||||
} else {
|
||||
await doComment(id);
|
||||
}
|
||||
|
||||
if (contents) {
|
||||
await doCreateCommentContent(owner, repo, commentId, dealStringToArr(contents));
|
||||
async function doComment(id) {
|
||||
const comment = await octokit.issues.getComment({
|
||||
owner,
|
||||
repo,
|
||||
comment_id: id,
|
||||
});
|
||||
const comment_body = comment.data.body;
|
||||
|
||||
let params = {
|
||||
owner,
|
||||
repo,
|
||||
comment_id: id,
|
||||
};
|
||||
|
||||
if (core.getInput('body') || ifUpdateBody) {
|
||||
if (updateMode === 'append') {
|
||||
params.body = `${comment_body}\n${body}`;
|
||||
} else {
|
||||
params.body = body;
|
||||
}
|
||||
|
||||
await octokit.issues.updateComment(params);
|
||||
core.info(`Actions: [update-comment][${id}] success!`);
|
||||
}
|
||||
|
||||
if (contents) {
|
||||
await doCreateCommentContent(owner, repo, id, dealStringToArr(contents));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -110,11 +110,7 @@ async function getIssuesInMonth(owner, repo, thisMonth, page = 1) {
|
||||
|
||||
// **************************************************************************
|
||||
function getCreatedMonth(d) {
|
||||
return (
|
||||
dayjs(d)
|
||||
.utc()
|
||||
.month() + 1
|
||||
);
|
||||
return dayjs(d).utc().month() + 1;
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
|
Reference in New Issue
Block a user