Repository navigation
chore: 同步 OSS 时排除 .git 和 ossutil 安装包 - #53
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
背景
sync-gh-pages.yml在仓库根目录执行ossutil cp -r .,会把 CI 工作目录里所有东西都传到 OSS,包括不属于网站的文件:.git/:git 版本库(打包的历史、分支名、提交人邮箱),以及actions/checkout写进.git/config的临时 GitHub tokenossutil.zip、ossutil-2.1.2-linux-amd64/:工作流自己下载解压的 ossutil 安装包2026-11-25 统计,14 个仓在
cn-rdk-front-prod上累计有 14,332 个.git文件、约 12.1 GB,其中rdk_s_doc、rdk_x_doc各约 5 GB。线上访问.git路径会被阿里云 WAF 拦截(405),但这些文件不该放在生产桶里,每次同步还要重复上传。改动
/.git/**、/ossutil.zip、/ossutil-*/**actions/checkout加persist-credentials: false,token 不再写进.git/config只改了这一个工作流,网站内容和上传目标不变。
验证
--dry-run:上述三类被排除;index.html、子目录页面、.nojekyll、search-index.json照常上传不在本 PR
OSS 上已有的
.git等文件需要另外清理,等这批 PR 合入后单独处理。🤖 Generated with Claude Code