From a96ba992391865f38695dfa970af0ac49b5421a9 Mon Sep 17 00:00:00 2001 From: Archana Shinde Date: Thu, 16 Feb 2023 17:27:58 -0800 Subject: [PATCH] actions: Use `git-diff` to get changes in kernel dir Use `git-diff` instead of legacy `git-whatchanged` to get differences in the packaging/kernel directory. This also fixes a bug by grepping for the kernel directory in the output of the git command. Fixes: #6210 Signed-off-by: Archana Shinde --- .github/workflows/static-checks.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/static-checks.yaml b/.github/workflows/static-checks.yaml index 0cb9d72d34..8d9858500b 100644 --- a/.github/workflows/static-checks.yaml +++ b/.github/workflows/static-checks.yaml @@ -43,8 +43,7 @@ jobs: kernel_dir="tools/packaging/kernel/" kernel_version_file="${kernel_dir}kata_config_version" modified_files=$(git diff --name-only origin/main..HEAD) - result=$(git whatchanged origin/main..HEAD "${kernel_dir}" >>"/dev/null") - if git whatchanged origin/main..HEAD "${kernel_dir}" >>"/dev/null"; then + if git diff --name-only origin/main..HEAD "${kernel_dir}" | grep "${kernel_dir}"; then echo "Kernel directory has changed, checking if $kernel_version_file has been updated" if echo "$modified_files" | grep -v "README.md" | grep "${kernel_dir}" >>"/dev/null"; then echo "$modified_files" | grep "$kernel_version_file" >>/dev/null || ( echo "Please bump version in $kernel_version_file" && exit 1)