From 266015feeeddcde882e78d75725c922e521bb070 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Fri, 11 Apr 2025 09:17:05 +0900 Subject: [PATCH] NO-ISSUE fix mistake --- .github/workflows/generate-code.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generate-code.yml b/.github/workflows/generate-code.yml index 5ecde70ed..384c1c8c6 100644 --- a/.github/workflows/generate-code.yml +++ b/.github/workflows/generate-code.yml @@ -40,15 +40,24 @@ jobs: 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]' }} + ## Run if diff exists and pull request or merge queue, and make CI status failure (but allow renovate bot) + - if: >- + ${{ + (github.event_name == 'pull_request' || github.event_name == 'merge_group') + && env.DIFF_IS_EMPTY != 'true' + && github.actor != 'renovate[bot]' + }} run: | echo "There are changes in the generated codes. Please run 'generate-code.py' and commit the changes." >&2 echo "The files with differences are as follows." >&2 echo "$(git --no-pager diff --name-only HEAD)" >&2 exit 1 - ## Run if diff exists and event is not pull request, and make PR - - if: ${{ github.event_name != 'pull_request' && env.DIFF_IS_EMPTY != 'true' }} + ## Run if diff exists and event is push or workflow_dispatch, make PR + - if: >- + ${{ + (github.event_name == 'push' || github.event_name == 'workflow_dispatch') + && env.DIFF_IS_EMPTY != 'true' + }} run: | # Determine Change Type via Submodule Script. This scripts read current uncommited changes. CHANGE_TYPE=$(npx zx ./line-openapi/tools/determine-change-type.mjs)