⭐ Base

In order to better display the function, the following is an example of the actual scene, please refer to it flexibly.

add-assignees

When an issue is added or modified, assign this issue to one or more people.

name: Add Assigness
on:
issues:
types: [opened, edited]
jobs:
add-assigness:
runs-on: ubuntu-latest
steps:
- name: Add assigness
uses: actions-cool/issues-helper@v1
with:
actions: 'add-assignees'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
assignees: 'xxx' or 'xx1,xx2'
ParamDescTypeRequiredVersion
actionsAction typestringv1
tokenToken explainstringv1
issue-numberThe number of issuenumberv1
assigneesDesignated person. No operation when no input or empty characterstringv1.1
  • actions support multiple and separated by comma. Like: add-assignees,add-labels
  • The name can be modified according to the actual situation
  • Reference to on
  • ${{ github.event.issue.number }} is the current issue. More references
  • assignees support multiple and separated by comma. Pay attention to multiple settings, you need to use the version above v1.1

add-labels

When the content of a new issue does not contain the specified format, add labels for the issue.

name: Add Labels
on:
issues:
types: [opened]
jobs:
add-labels:
runs-on: ubuntu-latest
if: contains(github.event.issue.body, 'xxx') == false
steps:
- name: Add labels
uses: actions-cool/issues-helper@v1
with:
actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: 'bug' or 'xx1,xx2'
ParamDescTypeRequiredVersion
actionsAction typestringv1
tokenToken explainstringv1
issue-numberThe number of issuenumberv1
labelsNew labels. When it is not filled in or is empty character, do not addstringv1.1
  • labels support multiple and separated by comma. Pay attention to multiple settings, you need to use the version above v1.1

close-issue

Close the specified issue.

- name: Close issue
uses: actions-cool/issues-helper@v1
with:
actions: 'close-issue'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: xxx
body: 'This is auto closed.'
ParamDescTypeRequiredVersion
actionsAction typestringv1
tokenToken explainstringv1
issue-numberThe number of issuenumberv1

create-comment

When a designated label is added, comment on the issue.

name: Create Comment
on:
issues:
types: [labeled]
jobs:
create-comment:
runs-on: ubuntu-latest
if: github.event.label.name == 'xxx'
steps:
- name: Create comment
uses: actions-cool/issues-helper@v1
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. Add some comments.
你好 @${{ github.event.issue.user.login }}。巴拉巴拉。
contents: '+1' or '+1,heart'
ParamDescTypeRequiredVersion
actionsAction typestringv1
tokenToken explainstringv1
issue-numberThe number of issuenumberv1
bodyAdd comment contentstringv1
contentsAdd reactionstringv1.1
  • body default is Currently at ${owner}/${repo}. And this is default comment.
    • Where ${owner}/${repo} means the current repo
  • Return comment-id, which can be used for subsequent operations. Usage reference
  • ${{ 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

create-issue

Here is an example, add an issue at UTC 00:00 on the 1st of every month.

name: Create Issue
on:
schedule:
- cron: "0 0 1 * *"
jobs:
create-issue:
runs-on: ubuntu-latest
steps:
- name: Create issue
uses: actions-cool/issues-helper@v1
with:
actions: 'create-issue'
token: ${{ secrets.GITHUB_TOKEN }}
title: 'xxxx'
body: 'xxxx'
labels: 'xx'
assignees: 'xxx'
contents: '+1'
ParamDescTypeRequiredVersion
actionsAction typestringv1
tokenToken explainstringv1
titleThe title of the new issuestringv1
bodyThe body of the new issuestringv1
labelsThe labels for the new issuestringv1.1
assigneesThe assignees for the new issuestringv1.1
contentsAdd reactionstringv1.1

delete-comment

According to comment-id delete the specified comment.

- name: Delete comment
uses: actions-cool/issues-helper@v1
with:
actions: 'delete-comment'
token: ${{ secrets.GITHUB_TOKEN }}
comment-id: xxx
ParamDescTypeRequiredVersion
actionsAction typestringv1
tokenToken explainstringv1
comment-idThe comment IDnumberv1

lock-issue

When the invalid label is added, the issue is locked.

name: Lock Issue
on:
issues:
types: [labeled]
jobs:
lock-issue:
runs-on: ubuntu-latest
if: github.event.label.name == 'invalid'
steps:
- name: Lock issue
uses: actions-cool/issues-helper@v1
with:
actions: 'lock-issue'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
ParamDescTypeRequiredVersion
actionsAction typestringv1
tokenToken explainstringv1
issue-numberThe number of issuenumberv1

mark-duplicate

Quickly mark duplicate questions, only for issue new comments.

name: Issue Mark Duplicate
on:
issue_comment:
types: [created]
jobs:
mark-duplicate:
runs-on: ubuntu-latest
steps:
- name: mark-duplicate
uses: actions-cool/issues-helper@v1.5
with:
actions: 'mark-duplicate'
token: ${{ secrets.GITHUB_TOKEN }}
ParamDescTypeRequiredVersion
actionsAction typestringv1.5
tokenToken explainstringv1.5
duplicate-commandSimple commands can be set, such as: /dstringv1.6
duplicate-labelsAdd additional labels to this issuestringv1.5
labelsReplace the labels of the issuestringv1.5
contentsAdd reaction for this commentstringv1.5
close-issueWhether to close the issue at the same timestringv1.6
  • duplicate-command: When setting concise commands, while still supporting the original Duplicate of
  • close-issue: Both true or 'true' can take effect
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.

open-issue

Open the specified issue.

- name: Open issue
uses: actions-cool/issues-helper@v1
with:
actions: 'open-issue'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: xxx
ParamDescTypeRequiredVersion
actionsAction typestringv1
tokenToken explainstringv1
issue-numberThe number of issuenumberv1

remove-assignees

Remove the person designated by issue.

- name: Remove assignees
uses: actions-cool/issues-helper@v1
with:
actions: 'remove-assignees'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
assignees: 'xx'
ParamDescTypeRequiredVersion
actionsAction typestringv1
tokenToken explainstringv1
issue-numberThe number of issuenumberv1
assigneesDesignated person removed. When it is an empty character, do not removestringv1.1

remove-labels

Remove the specified labels.

- name: Remove labels
uses: actions-cool/issues-helper@v1.2
with:
actions: 'remove-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: 'xx'
ParamDescTypeRequiredVersion
actionsAction typestringv1.2
tokenToken explainstringv1.2
issue-numberThe number of issuenumberv1.2
labelsThe removed labels. When it is a blank character, do not removestringv1.2
  • labels supports multiple, such as x1,x2,x3, only the labels added by the issue will be removed

set-labels

Replace the labels of issue.

- name: Set labels
uses: actions-cool/issues-helper@v1
with:
actions: 'set-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: 'xx'
ParamDescTypeRequiredVersion
actionsAction typestringv1
tokenToken explainstringv1
issue-numberThe number of issuenumberv1
labelslabels set. When empty characters, will remove allstringv1.1

unlock-issue

Unlock the specified issue.

- name: Unlock issue
uses: actions-cool/issues-helper@v1
with:
actions: 'unlock-issue'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
ParamDescTypeRequiredVersion
actionsAction typestringv1
tokenToken explainstringv1
issue-numberThe number of issuenumberv1

update-comment

Update the specified comment according to comment-id.

The following example shows that 👀 is added for each new comment.

name: Add eyes to each comment
on:
issue_comment:
types: [created]
jobs:
update-comment:
runs-on: ubuntu-latest
steps:
- name: Update comment
uses: actions-cool/issues-helper@v1
with:
actions: 'update-comment'
token: ${{ secrets.GITHUB_TOKEN }}
comment-id: ${{ github.event.comment.id }}
contents: 'eyes'
ParamDescTypeRequiredVersion
actionsAction typestringv1
tokenToken explainstringv1
comment-idThe comment IDnumberv1
bodyUpdate the content of commentstringv1
update-modeUpdate mode. Default replace, another appendstringv1
contentsAdd reactionstringv1.1
  • When body is not entered, it will remain as it is
  • When update-mode is append, additional operations will be performed. Anything other than append will be replaced. Only effective for body

update-issue

Update the specified issue according to the issue-number.

- name: Update issue
uses: actions-cool/issues-helper@v1
with:
actions: 'update-issue'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
state: 'open'
title: 'xxx'
body: 'xxxx'
update-mode: 'replace'
labels: 'xx'
assignees: 'xxx'
contents: '+1'
ParamDescTypeRequiredVersion
actionsAction typestringv1
tokenToken explainstringv1
issue-numberThe number of issuenumberv1
stateModify the status of issue, optional value open closedstringv1
titleModify the title of the issuestringv1
bodyModify the content of issuestringv1
update-modeUpdate mode. Default replace, another appendstringv1
labelsReplace the labels of issuestringv1.1
assigneesReplace the assignees of issuestringv1.1
contentsAdd reactionstringv1.1
  • state defaults to open
  • When the option is not filled, it will keep the original

welcome

When an issue is created, the user who created the issue for the first time is welcome.

If the user is not creating for the first time, there is no operation.

name: Issue Welcome
on:
issues:
types: [opened]
jobs:
issue-welcome:
runs-on: ubuntu-latest
steps:
- name: welcome
uses: actions-cool/issues-helper@v1.3
with:
actions: 'welcome'
token: ${{ secrets.GITHUB_TOKEN }}
body: hi @${{ github.event.issue.user.login }}, welcome!
labels: 'welcome1, welcome2'
assignees: 'xx1'
issue-contents: '+1, -1, eyes'
ParamDescTypeRequiredVersion
actionsAction typestringv1.3
tokenToken explainstringv1.3
bodyComment on the welcome content, no comment if you leave it blankstringv1.3
labelsAdd labels to this issuestringv1.3
assigneesAdd assignees to this issuestringv1.3
issue-contentsAdd reaction to this issuestringv1.3
  • If these 4 options are not filled, no operation