From 4024efc71911ca79a4b5e4c64fc9aa6fd7ce37c2 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Fri, 28 Mar 2025 14:07:05 +0900 Subject: [PATCH] NO-ISSUE Skip creating PR when only git submodule is updated --- .github/workflows/generate-code.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-code.yml b/.github/workflows/generate-code.yml index 7ed4d9eaa..d774f3d93 100644 --- a/.github/workflows/generate-code.yml +++ b/.github/workflows/generate-code.yml @@ -31,8 +31,13 @@ jobs: run: | python generate-code.py - diff=$(git --no-pager diff --name-only HEAD) - echo "DIFF_IS_EMPTY=$([[ -z "$diff" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV + diff_files=$(git --no-pager diff --name-only) + diff_excluding_submodule=$(echo "$diff_files" | grep -v '^line-openapi$' || true) + + echo "diff files: $diff_files" + echo "diff excluding submodule: $diff_excluding_submodule" + + echo "DIFF_IS_EMPTY=$([[ -z "$diff_excluding_submodule" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV ## Run if diff exists and pull request, and make CI status failure (but allow renovate bot) - if: ${{ github.event_name == 'pull_request' && env.DIFF_IS_EMPTY != 'true' && github.actor != 'renovate[bot]' }}