Conversation
Replace directory scanning with find command to locate all zip files in bazel output directory.
Closed
WhiteElephant-abc
requested changes
Jan 24, 2026
Fix build artifact collection logic to only search within subprojects directory, avoiding inclusion of other ZIP files. The previous find command recursively searched all ZIP files in bazel-bin, which could include unintended artifacts. The new loop specifically targets subprojects/*/ directories and looks for directory-named ZIP files, matching the original workflow's intent. Addresses review feedback from PR #??.
Contributor
Author
工作总结根据Pull Request中的review反馈,我已修复构建产物收集逻辑中的缺陷。 问题分析原PR中的修改使用 解决方案将 mkdir -p release_artifacts
BIN_PATH=$(bazel info bazel-bin)
for dir in "$BIN_PATH/subprojects"/*/ ; do
dir_name=$(basename "$dir")
zip_file="$dir/${dir_name}.zip"
if [ -f "$zip_file" ]; then
cp "$zip_file" release_artifacts/
fi
done关键改进
提交记录已按照项目提交规范创建提交: 此修改确保构建产物收集仅针对 |
WhiteElephant-abc
approved these changes
Jan 24, 2026
This file contains hidden or 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
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.

问题分析与解决
问题根源
构建工作流
build-with-bazel在 GitHub Actions 中运行时报错:"No files were found with the provided path: release_artifacts/. No artifacts will be uploaded。"经过分析,发现原脚本的构建产物收集逻辑存在缺陷。原脚本问题
.github/workflows/build.yml:21-32中的构建产物收集脚本使用以下逻辑:这个逻辑假设:
$BIN_PATH) 下每个子目录都对应一个数据包目录名.zip但实际构建输出结构是:
bazel-bin/subprojects/stone-disappearance/stone-disappearance.zipbazel-bin/subprojects/auto-lucky-block/auto-lucky-block.zip原脚本在
$BIN_PATH/subprojects/目录下查找subprojects.zip,显然无法找到正确的构建产物。解决方案
将构建产物收集逻辑从目录扫描改为使用
find命令递归查找所有 ZIP 文件:修改内容
.github/workflows/build.yml:21-32验证测试
bazel build //subprojects/stone-disappearance测试构建成功find命令能正确找到构建产物:/home/runner/.cache/bazel/.../bin/subprojects/stone-disappearance/stone-disappearance.ziprelease_artifacts/目录提交记录
已按照项目提交规范创建提交:
6bea609 👷 ci: fix build artifact collection影响范围
release.yml) 和其他 CI/CD 流程Closes #132
opencode session | github run