Skip to content

[bug] fix: requirements.txt 添加 ruff,build_release.yml 与 check_fix_push.yml 均添加 Python 依赖安装 - #283

Closed
AliusCode wants to merge 0 commit into
Lin-arm:mainfrom
AliusCode:main
Closed

[bug] fix: requirements.txt 添加 ruff,build_release.yml 与 check_fix_push.yml 均添加 Python 依赖安装#283
AliusCode wants to merge 0 commit into
Lin-arm:mainfrom
AliusCode:main

Conversation

@AliusCode

Copy link
Copy Markdown
Collaborator

fix: requirements.txt 添加 ruff,build_release.yml 与 check_fix_push.yml 均添加 Python 依赖安装

CLI 自动化无 python 依赖安装环节导致:

  • Python/YAML 文件变更时,跳过 Python 测试, ad-m/github-push-action@master 不发生报错
  • 当 Python/YAML 文件变更时,进入 Python 测试,但环节中无依赖安装,导致报错发生

具体测试情况查看我 fork 仓库中的 Actions ,共6条(最早的6条,查看较晚会多出几条,是同步分支从上游拉取更新推送检查的 workflows ,不用管),6条依次分别为:

  • branch sync-fork 分支推送检查
  • 新 fork 仓库 Python/YAML 文件变更的 build_release 运行,即第一次 build_release ,成功,因跳过没有触发报错
  • 新增 YAML 的推送检查
  • Python/YAML 文件变更的 build_release 运行,即第二次 build_release ,失败,因没有安装 ruff 和 httpx 依赖库无法运行 Python 脚本导致失败
  • 修复 build_release.yml 与 check_fix_push.yml 的推送检查
  • Python/YAML 文件变更的 build_release 运行,即第三次 build_release ,成功, ruff 和 httpx 依赖库安装成功, Python 脚本运行成功,最终打包成功

@Lin-arm

Lin-arm commented Jul 31, 2026

Copy link
Copy Markdown
Owner

build_release 就负责 打包构建、发版 而已,应该不需要主动检测 Python / YAML 文件变更吧。
check_fix_push 负责 代码格式化 ,也用不到检测 Python / YAML 文件变更。

平时提的 PR 倒是需要检测 Python / YAML 文件变更,这一块由 pull_request_check 在做了。


你那边执行 build_release 报错,是之前直接推送 “含有 YAML 文件变更的提交” 到你的主仓库了,而不是通过 PR 的方式合并。

build_release 里新增 Python依赖安装 ,会增加7秒左右的耗时。

你试试将原先的 .github/workflows/build_release.yml推送代码到远程仓库 这一步改成:

    - name: 推送代码到远程仓库
      if: ${{ steps.commit.outcome == 'success' }}
      run: |
        # 关闭husky钩子执行,直接推送
        HUSKY=0 git push origin ${{ github.ref_name }} --tags
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants