ci: fix opencode fork review merge base (#1451)

This commit is contained in:
Carlos Florêncio
2026-06-20 19:37:17 +01:00
committed by GitHub
parent f4a906884f
commit 2b93545a4d
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -286,7 +286,7 @@ jobs:
REVIEW_DIR=.opencode-review
rm -rf "$REVIEW_DIR"
mkdir -p "$REVIEW_DIR"
git fetch --no-tags --prune --depth=1 origin "$BASE_SHA"
git fetch --no-tags --prune origin "$BASE_SHA"
if [[ "$ACTION" == "synchronize" ]] &&
[[ -n "${BEFORE:-}" ]] &&
+12
View File
@@ -46,6 +46,18 @@ if [[ "$relative_patch_count" != "2" ]]; then
fi
pass "OpenCode patches are passed as relative workspace files in both workflow paths"
fork_base_fetch_count="$(count_occurrences 'git fetch --no-tags --prune origin "$BASE_SHA"')"
if [[ "$fork_base_fetch_count" != "1" ]]; then
fail "Fork review fetches the trusted base commit before building the diff"
fi
pass "Fork review fetches the trusted base commit before building the diff"
shallow_base_fetch_count="$(count_occurrences 'git fetch --no-tags --prune --depth=1 origin "$BASE_SHA"')"
if [[ "$shallow_base_fetch_count" != "0" ]]; then
fail "Fork review does not shallow-fetch the base commit before a three-dot diff"
fi
pass "Fork review does not shallow-fetch the base commit before a three-dot diff"
recreate_config_count="$(count_occurrences 'rm -rf .opencode')"
if [[ "$recreate_config_count" != "2" ]]; then
fail "OpenCode project config is recreated before writing the review agent"