Skip to content

Commit

Permalink
remove: 移除 pre-commit 相关操作
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 committed Dec 5, 2024
1 parent 794b16a commit d81f1da
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 33 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/
- 修复机器人修改议题等操作时仍会触发响应器的问题
- 修复修改配置流程中忘记修改标题的问题

### Removed

- 移除 pre-commit 相关操作

## [4.1.1] - 2024-12-01

### Added
Expand Down
9 changes: 0 additions & 9 deletions examples/noneflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ jobs:
with:
token: ${{ steps.generate-token.outputs.token }}

- name: Cache pre-commit hooks
uses: actions/cache@v4
with:
path: .cache/.pre-commit
key: noneflow-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}

- name: NoneFlow
uses: docker://ghcr.io/nonebot/noneflow:latest
with:
Expand All @@ -70,6 +64,3 @@ jobs:
APP_ID: ${{ secrets.APP_ID }}
PRIVATE_KEY: ${{ secrets.APP_KEY }}
PRE_COMMIT_HOME: /github/workspace/.cache/.pre-commit

- name: Fix permission
run: sudo chown -R $(whoami):$(id -ng) .cache/.pre-commit
21 changes: 5 additions & 16 deletions src/plugins/github/plugins/publish/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
get_issue_handler,
get_related_issue_handler,
get_related_issue_number,
install_pre_commit_hooks,
is_bot_triggered_workflow,
is_publish_workflow,
)
Expand Down Expand Up @@ -74,9 +73,7 @@ async def check_rule(
)


@publish_check_matcher.handle(
parameterless=[Depends(bypass_git), Depends(install_pre_commit_hooks)]
)
@publish_check_matcher.handle(parameterless=[Depends(bypass_git)])
async def handle_publish_plugin_check(
bot: GitHubBot,
state: T_State,
Expand Down Expand Up @@ -108,9 +105,7 @@ async def handle_publish_plugin_check(
state["validation"] = result


@publish_check_matcher.handle(
parameterless=[Depends(bypass_git), Depends(install_pre_commit_hooks)]
)
@publish_check_matcher.handle(parameterless=[Depends(bypass_git)])
async def handle_adapter_publish_check(
bot: GitHubBot,
state: T_State,
Expand All @@ -130,9 +125,7 @@ async def handle_adapter_publish_check(
state["validation"] = result


@publish_check_matcher.handle(
parameterless=[Depends(bypass_git), Depends(install_pre_commit_hooks)]
)
@publish_check_matcher.handle(parameterless=[Depends(bypass_git)])
async def handle_bot_publish_check(
bot: GitHubBot,
state: T_State,
Expand All @@ -152,9 +145,7 @@ async def handle_bot_publish_check(
state["validation"] = result


@publish_check_matcher.handle(
parameterless=[Depends(bypass_git), Depends(install_pre_commit_hooks)]
)
@publish_check_matcher.handle(parameterless=[Depends(bypass_git)])
async def handle_pull_request_and_update_issue(
bot: GitHubBot,
validation: ValidationDict = Arg(),
Expand Down Expand Up @@ -199,9 +190,7 @@ async def pr_close_rule(
pr_close_matcher = on_type(PullRequestClosed, rule=Rule(pr_close_rule))


@pr_close_matcher.handle(
parameterless=[Depends(bypass_git), Depends(install_pre_commit_hooks)]
)
@pr_close_matcher.handle(parameterless=[Depends(bypass_git)])
async def handle_pr_close(
event: PullRequestClosed,
bot: GitHubBot,
Expand Down
5 changes: 1 addition & 4 deletions src/plugins/github/plugins/remove/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
get_issue_handler,
get_related_issue_number,
get_type_by_labels_name,
install_pre_commit_hooks,
is_bot_triggered_workflow,
is_remove_workflow,
)
Expand Down Expand Up @@ -71,9 +70,7 @@ async def check_rule(
)


@remove_check_matcher.handle(
parameterless=[Depends(bypass_git), Depends(install_pre_commit_hooks)]
)
@remove_check_matcher.handle(parameterless=[Depends(bypass_git)])
async def handle_remove_check(
bot: GitHubBot,
installation_id: int = Depends(get_installation_id),
Expand Down
5 changes: 1 addition & 4 deletions src/plugins/github/plugins/resolve/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
get_related_issue_handler,
get_related_issue_number,
get_type_by_labels_name,
install_pre_commit_hooks,
is_publish_workflow,
is_remove_workflow,
)
Expand Down Expand Up @@ -43,9 +42,7 @@ async def pr_close_rule(
pr_close_matcher = on_type(PullRequestClosed, rule=pr_close_rule, priority=10)


@pr_close_matcher.handle(
parameterless=[Depends(bypass_git), Depends(install_pre_commit_hooks)]
)
@pr_close_matcher.handle(parameterless=[Depends(bypass_git)])
async def handle_pr_close(
event: PullRequestClosed,
bot: GitHubBot,
Expand Down

0 comments on commit d81f1da

Please sign in to comment.