Skip to content

Commit

Permalink
change: 修改项目名称
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 committed Apr 7, 2023
1 parent f86f1d7 commit b6da825
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
uses: docker/metadata-action@v4
id: metadata
with:
images: ghcr.io/nonebot/nonebot2-publish-bot
images: ghcr.io/nonebot/noneflow
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
Expand Down
4 changes: 3 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"GITHUB_EVENT_PATH": "${workspaceFolder}/tests/plugin-test/issue-comment.json",
"GITHUB_APPS": "[{\"client_id\": 1111, \"client_secret\": 12312}]",
"GITHUB_REPOSITORY": "owner/repo",
"INPUT_CONFIG": "{\"base\": \"master\", \"plugin_path\": \"website/static/plugins.json\", \"bot_path\": \"website/static/bots.json\", \"adapter_path\": \"website/static/adapters.json\"}"
"INPUT_CONFIG": "{\"base\": \"master\", \"plugin_path\": \"website/static/plugins.json\", \"bot_path\": \"website/static/bots.json\", \"adapter_path\": \"website/static/adapters.json\"}",
"APP_ID": "123",
"PRIVATE_KEY": "123123"
}
},
{
Expand Down
30 changes: 15 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/

- 最初的版本

[unreleased]: https://github.com/nonebot/nonebot2-publish-bot/compare/v2.0.0...HEAD
[2.0.0]: https://github.com/nonebot/nonebot2-publish-bot/compare/v1.2.1...v2.0.0
[1.2.1]: https://github.com/nonebot/nonebot2-publish-bot/compare/v1.2.0...v1.2.1
[1.2.0]: https://github.com/nonebot/nonebot2-publish-bot/compare/v1.1.2...v1.2.0
[1.1.2]: https://github.com/nonebot/nonebot2-publish-bot/compare/v1.1.1...v1.1.2
[1.1.1]: https://github.com/nonebot/nonebot2-publish-bot/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/nonebot/nonebot2-publish-bot/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/nonebot/nonebot2-publish-bot/compare/v0.5.2...v1.0.0
[0.5.2]: https://github.com/nonebot/nonebot2-publish-bot/compare/v0.5.1...v0.5.2
[0.5.1]: https://github.com/nonebot/nonebot2-publish-bot/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/nonebot/nonebot2-publish-bot/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/nonebot/nonebot2-publish-bot/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/nonebot/nonebot2-publish-bot/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/nonebot/nonebot2-publish-bot/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/nonebot/nonebot2-publish-bot/releases/tag/v0.1.0
[unreleased]: https://github.com/nonebot/noneflow/compare/v2.0.0...HEAD
[2.0.0]: https://github.com/nonebot/noneflow/compare/v1.2.1...v2.0.0
[1.2.1]: https://github.com/nonebot/noneflow/compare/v1.2.0...v1.2.1
[1.2.0]: https://github.com/nonebot/noneflow/compare/v1.1.2...v1.2.0
[1.1.2]: https://github.com/nonebot/noneflow/compare/v1.1.1...v1.1.2
[1.1.1]: https://github.com/nonebot/noneflow/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/nonebot/noneflow/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/nonebot/noneflow/compare/v0.5.2...v1.0.0
[0.5.2]: https://github.com/nonebot/noneflow/compare/v0.5.1...v0.5.2
[0.5.1]: https://github.com/nonebot/noneflow/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/nonebot/noneflow/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/nonebot/noneflow/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/nonebot/noneflow/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/nonebot/noneflow/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/nonebot/noneflow/releases/tag/v0.1.0
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NoneBot2 Publish Bot
# NoneFlow

[![codecov](https://codecov.io/gh/nonebot/nonebot2-publish-bot/branch/main/graph/badge.svg?token=BOIBTOCWCH)](https://codecov.io/gh/nonebot/nonebot2-publish-bot)
[![codecov](https://codecov.io/gh/nonebot/noneflow/branch/main/graph/badge.svg?token=BOIBTOCWCH)](https://codecov.io/gh/nonebot/noneflow)

[NoneBot2](https://github.com/nonebot/nonebot2) 插件/协议/机器人 发布机器人

Expand Down Expand Up @@ -28,7 +28,7 @@
简单的示例

```yaml
name: NoneBot2 Publish Bot
name: NoneFlow

on:
issues:
Expand Down Expand Up @@ -67,10 +67,10 @@ jobs:
- name: Test Plugin
id: plugin-test
run: |
curl -sSL https://github.com/nonebot/nonebot2-publish-bot/releases/latest/download/plugin_test.py | python -
publish_bot:
curl -sSL https://github.com/nonebot/noneflow/releases/latest/download/plugin_test.py | python -
noneflow:
runs-on: ubuntu-latest
name: nonebot2 publish bot
name: noneflow
needs: plugin_test
steps:
- name: Generate token
Expand All @@ -85,8 +85,8 @@ jobs:
with:
token: ${{ steps.generate-token.outputs.token }}

- name: NoneBot2 Publish Bot
uses: docker://ghcr.io/nonebot/nonebot2-publish-bot:latest
- name: NoneFlow
uses: docker://ghcr.io/nonebot/noneflow:latest
with:
config: >
{
Expand Down
19 changes: 8 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
name: 'NoneBot2 Publish Bot'
description: 'Manage publish related issues in nonebot2 project'
author: 'hemengyang <[email protected]>'
name: "NoneFlow"
description: "Manage publish related issues in nonebot2 project"
author: "hemengyang <[email protected]>"
inputs:
token:
description: 'Token for the repo. Can be passed in using {{ secrets.GITHUB_TOKEN }}'
required: true
config:
description: 'JSON with settings as described in the README'
description: "JSON with settings as described in the README"
required: true
runs:
using: 'docker'
image: 'Dockerfile'
using: "docker"
image: "Dockerfile"
branding:
icon: 'box'
color: 'orange'
icon: "box"
color: "orange"
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[tool.poetry]
name = "nonebot2-publish-bot"
name = "noneflow"
version = "2.0.0"
description = "Manage publish related issues in nonebot2 project"
authors = ["hemengyang <[email protected]>"]
license = "MIT"
readme = "README.md"
homepage = "https://github.com/nonebot/nonebot2-publish-bot"
repository = "https://github.com/nonebot/nonebot2-publish-bot"
homepage = "https://github.com/nonebot/noneflow"
repository = "https://github.com/nonebot/noneflow"

[tool.poetry.dependencies]
python = "^3.11"
Expand Down
6 changes: 4 additions & 2 deletions src/plugins/publish/constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re

PUBLISH_BOT_MARKER = "<!-- PUBLISH_BOT -->"
NONEFLOW_MARKER = "<!-- NONEFLOW -->"

SKIP_PLUGIN_TEST_COMMENT = "/skip"

Expand All @@ -16,7 +16,9 @@

REUSE_MESSAGE = "♻️ 评论已更新至最新检查结果"

POWERED_BY_BOT_MESSAGE = "💪 Powered by [NoneBot2 Publish Bot](https://github.com/nonebot/nonebot2-publish-bot)"
POWERED_BY_NONEFLOW_MESSAGE = (
"💪 Powered by [NoneFlow](https://github.com/nonebot/noneflow)"
)

DETAIL_MESSAGE_TEMPLATE = (
"<details><summary>详情</summary><pre><code>{detail_message}</code></pre></details>"
Expand Down
12 changes: 6 additions & 6 deletions src/plugins/publish/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
COMMENT_MESSAGE_TEMPLATE,
COMMENT_TITLE,
COMMIT_MESSAGE_PREFIX,
POWERED_BY_BOT_MESSAGE,
PUBLISH_BOT_MARKER,
NONEFLOW_MARKER,
POWERED_BY_NONEFLOW_MESSAGE,
REUSE_MESSAGE,
SKIP_PLUGIN_TEST_COMMENT,
TIPS_MESSAGE,
Expand Down Expand Up @@ -266,16 +266,16 @@ async def comment_issue(bot: Bot, repo_info: RepoInfo, issue_number: int, body:
)
).parsed_data
reusable_comment = next(
filter(lambda x: PUBLISH_BOT_MARKER in (x.body if x.body else ""), comments),
filter(lambda x: NONEFLOW_MARKER in (x.body if x.body else ""), comments),
None,
)
if reusable_comment:
footer = f"{REUSE_MESSAGE}\n\n{POWERED_BY_BOT_MESSAGE}"
footer = f"{REUSE_MESSAGE}\n\n{POWERED_BY_NONEFLOW_MESSAGE}"
else:
footer = f"{POWERED_BY_BOT_MESSAGE}"
footer = f"{POWERED_BY_NONEFLOW_MESSAGE}"

# 添加发布机器人评论的标志
footer += f"\n{PUBLISH_BOT_MARKER}"
footer += f"\n{NONEFLOW_MARKER}"

comment = COMMENT_MESSAGE_TEMPLATE.format(
title=COMMENT_TITLE, body=body, tips=TIPS_MESSAGE, footer=footer
Expand Down
6 changes: 3 additions & 3 deletions tests/process/test_publish_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
# "owner",
# "repo",
# 1,
# body="""# 📃 商店发布检查结果\n\n> Bot: test\n\n**✅ 所有测试通过,一切准备就绪!**\n\n<details><summary>详情</summary><pre><code><li>✅ 标签: test-#ffffff。</li><li>✅ 项目 <a href="https://v2.nonebot.dev">主页</a> 返回状态码 200。</li></code></pre></details>\n\n---\n\n💡 如需修改信息,请直接修改 issue,机器人会自动更新检查结果。\n💡 当插件加载测试失败时,请发布新版本后在当前页面下评论任意内容以触发测试。\n\n💪 Powered by [NoneBot2 Publish Bot](https://github.com/nonebot/nonebot2-publish-bot)\n<!-- PUBLISH_BOT -->\n""",
# body="""# 📃 商店发布检查结果\n\n> Bot: test\n\n**✅ 所有测试通过,一切准备就绪!**\n\n<details><summary>详情</summary><pre><code><li>✅ 标签: test-#ffffff。</li><li>✅ 项目 <a href="https://v2.nonebot.dev">主页</a> 返回状态码 200。</li></code></pre></details>\n\n---\n\n💡 如需修改信息,请直接修改 issue,机器人会自动更新检查结果。\n💡 当插件加载测试失败时,请发布新版本后在当前页面下评论任意内容以触发测试。\n\n💪 Powered by [NoneBot2 Publish Bot](https://github.com/nonebot/noneflow)\n<!-- PUBLISH_BOT -->\n""",
# )


Expand Down Expand Up @@ -307,7 +307,7 @@
# "owner",
# "repo",
# 1,
# body="""# 📃 商店发布检查结果\n\n> Bot: test1\n\n**✅ 所有测试通过,一切准备就绪!**\n\n<details><summary>详情</summary><pre><code><li>✅ 标签: test-#ffffff。</li><li>✅ 项目 <a href="https://v2.nonebot.dev">主页</a> 返回状态码 200。</li></code></pre></details>\n\n---\n\n💡 如需修改信息,请直接修改 issue,机器人会自动更新检查结果。\n💡 当插件加载测试失败时,请发布新版本后在当前页面下评论任意内容以触发测试。\n\n💪 Powered by [NoneBot2 Publish Bot](https://github.com/nonebot/nonebot2-publish-bot)\n<!-- PUBLISH_BOT -->\n""",
# body="""# 📃 商店发布检查结果\n\n> Bot: test1\n\n**✅ 所有测试通过,一切准备就绪!**\n\n<details><summary>详情</summary><pre><code><li>✅ 标签: test-#ffffff。</li><li>✅ 项目 <a href="https://v2.nonebot.dev">主页</a> 返回状态码 200。</li></code></pre></details>\n\n---\n\n💡 如需修改信息,请直接修改 issue,机器人会自动更新检查结果。\n💡 当插件加载测试失败时,请发布新版本后在当前页面下评论任意内容以触发测试。\n\n💪 Powered by [NoneBot2 Publish Bot](https://github.com/nonebot/noneflow)\n<!-- PUBLISH_BOT -->\n""",
# )


Expand Down Expand Up @@ -376,7 +376,7 @@
# "owner",
# "repo",
# 1,
# body="""# 📃 商店发布检查结果\n\n> Bot: test\n\n**⚠️ 在发布检查过程中,我们发现以下问题:**\n<pre><code><li>⚠️ 项目 <a href="https://test">主页</a> 返回状态码 404。<dt>请确保您的项目主页可访问。</dt></li></code></pre>\n<details><summary>详情</summary><pre><code><li>✅ 标签: test-#ffffff。</li></code></pre></details>\n\n---\n\n💡 如需修改信息,请直接修改 issue,机器人会自动更新检查结果。\n💡 当插件加载测试失败时,请发布新版本后在当前页面下评论任意内容以触发测试。\n\n💪 Powered by [NoneBot2 Publish Bot](https://github.com/nonebot/nonebot2-publish-bot)\n<!-- PUBLISH_BOT -->\n""",
# body="""# 📃 商店发布检查结果\n\n> Bot: test\n\n**⚠️ 在发布检查过程中,我们发现以下问题:**\n<pre><code><li>⚠️ 项目 <a href="https://test">主页</a> 返回状态码 404。<dt>请确保您的项目主页可访问。</dt></li></code></pre>\n<details><summary>详情</summary><pre><code><li>✅ 标签: test-#ffffff。</li></code></pre></details>\n\n---\n\n💡 如需修改信息,请直接修改 issue,机器人会自动更新检查结果。\n💡 当插件加载测试失败时,请发布新版本后在当前页面下评论任意内容以触发测试。\n\n💪 Powered by [NoneBot2 Publish Bot](https://github.com/nonebot/noneflow)\n<!-- PUBLISH_BOT -->\n""",
# )


Expand Down
6 changes: 3 additions & 3 deletions tests/utils/test_comment_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# "owner",
# "repo",
# 1,
# body="# 📃 商店发布检查结果\n\ntest\n\n---\n\n💡 如需修改信息,请直接修改 issue,机器人会自动更新检查结果。\n💡 当插件加载测试失败时,请发布新版本后在当前页面下评论任意内容以触发测试。\n\n💪 Powered by [NoneBot2 Publish Bot](https://github.com/nonebot/nonebot2-publish-bot)\n<!-- PUBLISH_BOT -->\n",
# body="# 📃 商店发布检查结果\n\ntest\n\n---\n\n💡 如需修改信息,请直接修改 issue,机器人会自动更新检查结果。\n💡 当插件加载测试失败时,请发布新版本后在当前页面下评论任意内容以触发测试。\n\n💪 Powered by [NoneBot2 Publish Bot](https://github.com/nonebot/noneflow)\n<!-- PUBLISH_BOT -->\n",
# )


Expand All @@ -53,7 +53,7 @@
# "owner",
# "repo",
# 123,
# body="# 📃 商店发布检查结果\n\ntest\n\n---\n\n💡 如需修改信息,请直接修改 issue,机器人会自动更新检查结果。\n💡 当插件加载测试失败时,请发布新版本后在当前页面下评论任意内容以触发测试。\n\n♻️ 评论已更新至最新检查结果\n\n💪 Powered by [NoneBot2 Publish Bot](https://github.com/nonebot/nonebot2-publish-bot)\n<!-- PUBLISH_BOT -->\n",
# body="# 📃 商店发布检查结果\n\ntest\n\n---\n\n💡 如需修改信息,请直接修改 issue,机器人会自动更新检查结果。\n💡 当插件加载测试失败时,请发布新版本后在当前页面下评论任意内容以触发测试。\n\n♻️ 评论已更新至最新检查结果\n\n💪 Powered by [NoneBot2 Publish Bot](https://github.com/nonebot/noneflow)\n<!-- PUBLISH_BOT -->\n",
# )


Expand All @@ -68,7 +68,7 @@
# bot.github.rest.issues.list_comments.return_value = mock_list_comments_resp

# mock_comment = mocker.MagicMock()
# mock_comment.body = "# 📃 商店发布检查结果\n\ntest\n\n---\n\n💡 如需修改信息,请直接修改 issue,机器人会自动更新检查结果。\n💡 当插件加载测试失败时,请发布新版本后在当前页面下评论任意内容以触发测试。\n\n♻️ 评论已更新至最新检查结果\n\n💪 Powered by [NoneBot2 Publish Bot](https://github.com/nonebot/nonebot2-publish-bot)\n<!-- PUBLISH_BOT -->\n"
# mock_comment.body = "# 📃 商店发布检查结果\n\ntest\n\n---\n\n💡 如需修改信息,请直接修改 issue,机器人会自动更新检查结果。\n💡 当插件加载测试失败时,请发布新版本后在当前页面下评论任意内容以触发测试。\n\n♻️ 评论已更新至最新检查结果\n\n💪 Powered by [NoneBot2 Publish Bot](https://github.com/nonebot/noneflow)\n<!-- PUBLISH_BOT -->\n"
# mock_comment.id = 123
# mock_list_comments_resp.parsed_data = [mock_comment]

Expand Down

0 comments on commit b6da825

Please sign in to comment.