ci(github workflow): 修复ci配置中环境变量引用格式

将硬编码的env.CI_TARGET_REPO改为正确的${{ env.CI_TARGET_REPO }}格式,确保工作流条件判断能正确识别目标仓库
This commit is contained in:
DevBox
2026-05-31 11:48:38 +00:00
parent b0381e133c
commit 0c1ed0d1b1
+4 -4
View File
@@ -32,7 +32,7 @@ jobs:
lint-and-format:
name: 代码检查
runs-on: ubuntu-latest
if: github.repository == env.CI_TARGET_REPO
if: github.repository == ${{ env.CI_TARGET_REPO }}
steps:
- name: 检出代码
uses: actions/checkout@v4
@@ -69,7 +69,7 @@ jobs:
name: 构建与测试
runs-on: ubuntu-latest
needs: lint-and-format
if: github.repository == env.CI_TARGET_REPO
if: github.repository == ${{ env.CI_TARGET_REPO }}
services:
postgres:
@@ -209,7 +209,7 @@ jobs:
name: 安全扫描
runs-on: ubuntu-latest
needs: lint-and-format
if: github.repository == env.CI_TARGET_REPO
if: github.repository == ${{ env.CI_TARGET_REPO }}
steps:
- name: 检出代码
uses: actions/checkout@v4
@@ -248,7 +248,7 @@ jobs:
name: 构建交付物
runs-on: ubuntu-latest
needs: [build-and-test, security-scan]
if: github.repository == env.CI_TARGET_REPO && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
if: github.repository == ${{ env.CI_TARGET_REPO }} && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
outputs:
image-tag: ${{ steps.meta.outputs.version }}