diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index 1f42e14..73909eb 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -70,6 +70,7 @@ jobs: drivers: ${{ steps.detect.outputs.drivers }} has_changes: ${{ steps.detect.outputs.has_changes }} release_source: ${{ steps.detect.outputs.release_source }} + compare_base: ${{ steps.detect.outputs.compare_base }} source_commit: ${{ steps.published_source.outputs.source_commit }} has_manifest: ${{ steps.published_source.outputs.has_manifest }} steps: @@ -184,6 +185,7 @@ jobs: fi fi echo "drivers=${DRIVERS}" >> "$GITHUB_OUTPUT" + echo "compare_base=${BASE_REF}" >> "$GITHUB_OUTPUT" if [ -n "$DRIVERS" ]; then echo "has_changes=true" >> "$GITHUB_OUTPUT" echo "🧭 Changed driver agents: $DRIVERS" @@ -448,11 +450,11 @@ jobs: shell: bash run: | set -euo pipefail - BASE_REF="${{ needs.driver_agents.outputs.source_commit }}" + BASE_REF="${{ needs.driver_agents.outputs.compare_base }}" FALLBACK_DRIVERS="${{ needs.driver_agents.outputs.drivers }}" - if [[ -z "$BASE_REF" ]]; then - echo "⚠️ 未拿到已发布 driver release 源码提交,回退使用全局检测结果:${FALLBACK_DRIVERS}" + if [[ -z "$BASE_REF" || "$BASE_REF" == "all" ]]; then + echo "⚠️ 当前 driver 检测基线不可做平台 diff,回退使用全局检测结果:${FALLBACK_DRIVERS}" echo "drivers=${FALLBACK_DRIVERS}" >> "$GITHUB_OUTPUT" else echo "🧭 对比当前平台 revision:base=${BASE_REF} head=${GITHUB_SHA} platform=${{ matrix.platform }}"