From ceb210a582e848a6388f54ec2932984e9e950574 Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Mon, 12 Oct 2026 10:31:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=EF=BC=9A[skip=20ci]=20?= =?UTF-8?q?=E9=99=90=E5=88=B6=E7=8E=AF=E5=A2=83=E6=99=8B=E7=BA=A7=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/environment-promotion-guard.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitea/workflows/environment-promotion-guard.yml b/.gitea/workflows/environment-promotion-guard.yml index e3d36f3a..b895d6bd 100644 --- a/.gitea/workflows/environment-promotion-guard.yml +++ b/.gitea/workflows/environment-promotion-guard.yml @@ -16,11 +16,20 @@ jobs: env: TARGET_BRANCH: ${{ gitea.base_ref }} SOURCE_BRANCH: ${{ gitea.head_ref }} + SOURCE_REPOSITORY: ${{ gitea.event.pull_request.head.repo.full_name }} + TARGET_REPOSITORY: ${{ gitea.repository }} run: | set -euo pipefail test -n "$TARGET_BRANCH" test -n "$SOURCE_BRANCH" + test -n "$SOURCE_REPOSITORY" + test -n "$TARGET_REPOSITORY" + + if [[ "$SOURCE_REPOSITORY" != "$TARGET_REPOSITORY" ]]; then + echo "拒绝跨仓库环境晋级:$SOURCE_REPOSITORY -> $TARGET_REPOSITORY" + exit 1 + fi case "$TARGET_BRANCH:$SOURCE_BRANCH" in sit:dev|prod:sit)