fix: bad revision 'ORIG_HEAD'
This commit is contained in:
17
.github/workflows/jsonDataValidation.yml
vendored
17
.github/workflows/jsonDataValidation.yml
vendored
@@ -385,9 +385,22 @@ jobs:
|
|||||||
else
|
else
|
||||||
# 未关联PR或无法确定分支,直接提交到main分支
|
# 未关联PR或无法确定分支,直接提交到main分支
|
||||||
echo "未关联PR或无法确定分支,直接提交到main分支"
|
echo "未关联PR或无法确定分支,直接提交到main分支"
|
||||||
|
# 保存当前的修改
|
||||||
|
TEMP_COMMIT=$(git rev-parse HEAD)
|
||||||
|
echo "当前提交: ${TEMP_COMMIT}"
|
||||||
|
|
||||||
|
# 切换到main分支
|
||||||
git fetch upstream main
|
git fetch upstream main
|
||||||
git checkout upstream/main -b temp-main
|
git checkout -b temp-main upstream/main
|
||||||
git cherry-pick ORIG_HEAD
|
|
||||||
|
# 应用修改到main分支
|
||||||
|
# 方法1: 使用git diff和apply
|
||||||
|
git diff ${TEMP_COMMIT} --binary > /tmp/changes.patch
|
||||||
|
git apply /tmp/changes.patch
|
||||||
|
|
||||||
|
# 提交并推送
|
||||||
|
git add .
|
||||||
|
git commit -m "自动修复 JSON 格式和版本号 [ci skip]"
|
||||||
git push upstream temp-main:main
|
git push upstream temp-main:main
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user