diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index c798e354..6bb870b1 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -87,15 +87,50 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Get changed files + - name: Get changed cfg files id: cfg-files - uses: tj-actions/changed-files@v46 - with: - files: | - ./KVM/qemu/*.cfg + shell: bash + run: | + set -euo pipefail + + BASE="${{ github.event.pull_request.base.sha }}" + HEAD="${{ github.event.pull_request.head.sha }}" + MERGE_BASE="$(git merge-base "${BASE}" "${HEAD}")" + + echo "Base SHA: ${BASE}" + echo "Head SHA: ${HEAD}" + echo "Merge base: ${MERGE_BASE}" + + # Include added, copied, modified, renamed, and type-changed cfg files; exclude deleted files. + git diff --name-only --diff-filter=ACMRT "${MERGE_BASE}" "${HEAD}" -- 'KVM/qemu/*.cfg' > changed_cfg_files.txt + + echo "Changed cfg files:" + cat changed_cfg_files.txt || true + + { + echo "all_changed_files<> "$GITHUB_OUTPUT" + + if [ -s changed_cfg_files.txt ]; then + echo "any_changed=true" >> "$GITHUB_OUTPUT" + else + echo "any_changed=false" >> "$GITHUB_OUTPUT" + fi + - name: Set matrix id: set-matrix - run: echo matrix=$(python3 -c 'print("${{ steps.cfg-files.outputs.all_changed_files }}".split())') >> $GITHUB_OUTPUT + shell: bash + run: | + python3 - <<'PY' >> "$GITHUB_OUTPUT" + import json + + with open("changed_cfg_files.txt", "r", encoding="utf-8") as f: + files = [line.strip() for line in f if line.strip()] + + print(f"matrix={json.dumps(files)}") + PY - name: Check cfg files lint if: steps.cfg-files.outputs.any_changed == 'true' run: | diff --git a/KVM/qemu/tdx_seam_module.cfg b/KVM/qemu/tdx_seam_module.cfg index 49263b25..de4f533b 100644 --- a/KVM/qemu/tdx_seam_module.cfg +++ b/KVM/qemu/tdx_seam_module.cfg @@ -16,5 +16,5 @@ cpu_model = host read_cmd = "cat /sys/module/kvm_intel/parameters/%s" rdmsr_cmd = "rdmsr 0xfe --bitfield 15:15" - tdx_module_pattern = "tdx: module initialized" + tdx_module_pattern = "tdx: TDX-Module initialized" tdx_negative_pattern = "No TDX module loaded by BIOS"