Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 41 additions & 6 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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<<EOF"
cat changed_cfg_files.txt
echo "EOF"
} >> "$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: |
Expand Down
2 changes: 1 addition & 1 deletion KVM/qemu/tdx_seam_module.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading