mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-23 21:20:42 +08:00
绕过检查:允许检查 PR 外的提交,修复绕过检查
This commit is contained in:
parent
a31b145df9
commit
d77d2bc64e
@ -14,11 +14,13 @@ echo "[收集] 计算 PR 分支与目标分支的分叉点……"
|
||||
TARGET_BRANCH="${TRAVIS_BRANCH:-master}"
|
||||
echo "[收集] 目标分支设定为:${TARGET_BRANCH}"
|
||||
|
||||
MERGE_BASE="$(git merge-base "$TARGET_BRANCH" FETCH_HEAD)"
|
||||
MERGE_BASE='HEAD^'
|
||||
[ "$TRAVIS_PULL_REQUEST" != 'false' ] \
|
||||
&& MERGE_BASE="$(git merge-base "$TARGET_BRANCH" HEAD)"
|
||||
echo "[收集] 找到分叉节点:${MERGE_BASE}"
|
||||
|
||||
{
|
||||
git log --oneline "${MERGE_BASE}..FETCH_HEAD" | grep -Eq '^绕过检查:' && {
|
||||
git log --oneline "${MERGE_BASE}..HEAD" | grep -Eq '绕过检查' && {
|
||||
touch /tmp/bypass
|
||||
echo "[收集] 已标记为绕过检查项"
|
||||
}
|
||||
@ -26,7 +28,7 @@ echo "[收集] 找到分叉节点:${MERGE_BASE}"
|
||||
|
||||
echo "[收集] 写出文件变更列表……"
|
||||
|
||||
git diff "$MERGE_BASE" FETCH_HEAD --no-renames --name-status > /tmp/changes
|
||||
git diff "$MERGE_BASE" HEAD --no-renames --name-status > /tmp/changes
|
||||
echo "[收集] 已写出文件变更列表:"
|
||||
cat /tmp/changes
|
||||
{ [ -z "$(cat /tmp/changes)" ] && echo "(无变更)"; } || true
|
||||
|
Loading…
Reference in New Issue
Block a user