-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add toggle-labels
action
#132
Merged
xrkffgg
merged 19 commits into
actions-cool:main
from
Wxh16144-forks:wuxh/feat-toggle_labels
Jan 31, 2023
Merged
feat: add toggle-labels
action
#132
xrkffgg
merged 19 commits into
actions-cool:main
from
Wxh16144-forks:wuxh/feat-toggle_labels
Jan 31, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
功能描述可以再清晰一下 |
pr 描述已更新 |
|
This reverts commit b08e8f3.
大佬,我已经更新好了,麻烦 review 一下呢?(英文不太好,用的翻译😭 |
xrkffgg
reviewed
Jan 16, 2023
Co-authored-by: xrkffgg <[email protected]>
Co-authored-by: xrkffgg <[email protected]>
Co-authored-by: xrkffgg <[email protected]>
xrkffgg
reviewed
Jan 17, 2023
use npm run format
抱歉,我遗留了很多东西,希望下次细心点,麻烦作者重新 review 一下 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤔 这个变动的性质是?/ What is the nature of this change?
🔗 相关 Issue / Related Issue
💡 需求背景和解决方案 / Background or solution
需求背景
举个🌰:在维护 issue labels 的时候,会对新建的 issue 添加统一
Unread
标签, 然后对 issue body 进行判断,对不符合条件的 issue 我们期望移除Unread
, 然后追加一个Invalid
label, 现有的 action 不支持remove-labels,add-labels
同时使用。所以需要一个新的 action。解决方案
新建一个
toggle-labels
action,对现有的 labels 和 action 入参进行判断,如果现有 labels 在 action 入参中存在,则删除这个 label ,反之如果 labels 在 action 入参中不存在,则添加 action 入参的 labels。Example
假定我们的 action.yml 配置如下:
case 1. 创建一个不带 body 的 issue
result: 一个打开且带有
Unread
标签的 issue。case 2. 创建一个 body 带 actions-cool 关键词的 issue
result: 一个关闭且带有
Invalid
标签的 issuepreview:
case:
init.issueLabels
表示当前 issue 上的 labelsinit.actionInput
表示用户 action 配置 labelstoggleLabels.removeLabels
实际执行结果需要删除的 labelstoggleLabels.addLabels
实际执行结果需要添加的 labels📝 更新日志 / Changelog
toggle-labels
actiontoggle-labels
功能