Repository navigation
ci: specify bash shell for deepin build step - #346
Conversation
1. Add explicit shell: bash to the "Build qt5platform-plugins deb packages" step in the Deepin build workflow 2. The step relies on bash-specific features such as PIPESTATUS and pipefail-style handling of the tee pipeline 3. Without an explicit shell, GitHub Actions may default to sh on some runners, causing PIPESTATUS to be unavailable and the build status check to fail or behave incorrectly 4. Ensures consistent behavior across runner environments when capturing the build exit status Influence: 1. Trigger the qt5platform-plugins-deepin-build workflow and confirm it starts successfully 2. Verify the build step runs with bash and that PIPESTATUS is correctly evaluated 3. Test the failure path by intentionally causing dpkg-buildpackage to fail and confirm /tmp/build.log is printed and the job fails 4. Verify the success path produces packages without spurious failure 5. Confirm no regressions on runners where sh was previously used ci: 为 deepin 构建步骤指定 bash shell 1. 在 Deepin 构建工作流的 "Build qt5platform-plugins deb packages" 步骤 中显式添加 shell: bash 2. 该步骤依赖 bash 特有的功能,例如 PIPESTATUS 以及 tee 管道的错误处理 3. 如果不显式指定 shell,GitHub Actions 在某些运行器上可能默认使用 sh, 导致 PIPESTATUS 不可用,从而使构建状态检查失败或行为异常 4. 确保在不同运行器环境下捕获构建退出状态时行为一致 Influence: 1. 触发 qt5platform-plugins-deepin-build 工作流,确认其能正常启动 2. 验证构建步骤使用 bash 运行,且 PIPESTATUS 能被正确求值 3. 通过故意让 dpkg-buildpackage 失败来测试失败路径,确认会打印 /tmp/ build.log 并使任务失败 4. 验证成功路径能正常产出软件包且不会误报失败 5. 确认在之前使用 sh 的运行器上不会出现回归问题
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe Deepin CI workflow now explicitly runs the Debian package build step with Bash, ensuring Sequence diagram for the Bash-controlled Deepin package buildsequenceDiagram
participant Actions as GitHubActions
participant Bash
participant Builder as dpkg-buildpackage
participant Tee as tee
participant Log as build.log
Actions->>Bash: run build step
Bash->>Builder: dpkg-buildpackage -uc -us -b
Builder-->>Tee: build output and exit status
Tee->>Log: write /tmp/build.log
Bash->>Bash: PIPESTATUS[0]
alt build failed
Bash->>Log: print /tmp/build.log
Bash-->>Actions: fail job
else build succeeded
Bash-->>Actions: continue successfully
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 变更分析: 潜在问题: 建议: 无需修改。现有实现已通过 tee 管道 + 2. 代码质量 ✅评价: 优秀 ✅ 通过 变更分析: 变更最小化(单文件、单行、单一目的),不影响工作流中其他步骤;commit message 以中英文详细说明变更原因(bash 特有的 潜在问题: 建议: 无需修改。可选优化:后续维护该工作流时,可在其他同样使用 bash 特性的步骤中统一显式声明 3. 代码性能 ✅评价: 优秀 ✅ 通过 变更分析: 单行配置变更,不增加任何构建开销;显式指定 bash 反而避免了 sh 回退环境下构建状态判断失效导致的无效重跑。 潜在问题: 建议: 无需修改。 4. 代码安全 🔒评价: 存在0个安全漏洞 优秀 ✅ 通过 变更分析: 本次变更不涉及用户输入处理、密钥、权限(permissions)变更或外部命令注入面,未引入任何新的攻击面。
漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个 安全漏洞详情: 建议: 无需修改。存量提示(非本次变更引入,不计入评分):工作流中 apt 源使用 💡 改进建议代码示例# .github/workflows/qt5platform-plugins-deepin-build.yml
# 显式指定 bash,保证 PIPESTATUS 在所有运行器/容器环境下可用
- name: Build qt5platform-plugins deb packages
shell: bash
run: |
dpkg-buildpackage -uc -us -b 2>&1 | tee /tmp/build.log; BUILD_STATUS=${PIPESTATUS[0]}
if [ $BUILD_STATUS -ne 0 ]; then
echo "❌ Build failed! Last 200 lines of build log:"
tail -200 /tmp/build.log
exit $BUILD_STATUS
fi
echo "✅ qt5platform-plugins deb packages built successfully!"
ls -la ../本报告由 AI 代码审查工具自动生成 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Influence:
ci: 为 deepin 构建步骤指定 bash shell
Influence:
Summary by Sourcery
Ensure the Deepin package build workflow uses Bash for reliable build status reporting.
Bug Fixes:
CI: