Skip to content

Commit 4bb6a9e

Browse files
authored
Skip creating PR when only git submodule is updated (#1582)
same as line/line-bot-sdk-nodejs#1210
1 parent 93e2d43 commit 4bb6a9e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/generate-code.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ jobs:
3131
run: |
3232
python generate-code.py
3333
34-
diff=$(git --no-pager diff --name-only HEAD)
35-
echo "DIFF_IS_EMPTY=$([[ -z "$diff" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
34+
diff_files=$(git --no-pager diff --name-only)
35+
diff_excluding_submodule=$(echo "$diff_files" | grep -v '^line-openapi$' || true)
36+
37+
echo "diff files: $diff_files"
38+
echo "diff excluding submodule: $diff_excluding_submodule"
39+
40+
echo "DIFF_IS_EMPTY=$([[ -z "$diff_excluding_submodule" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
3641
echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
3742
## Run if diff exists and pull request, and make CI status failure (but allow renovate bot)
3843
- if: ${{ github.event_name == 'pull_request' && env.DIFF_IS_EMPTY != 'true' && github.actor != 'renovate[bot]' }}

0 commit comments

Comments
 (0)