Skip to content

Commit dad51e9

Browse files
authored
Skip creating PR when only git submodule is updated (#688)
same as line/line-bot-sdk-nodejs#1210
1 parent 0bc9784 commit dad51e9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/generate-code.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,13 @@ jobs:
5656
wget https://github.com/phpDocumentor/phpDocumentor/releases/download/v3.3.1/phpDocumentor.phar
5757
php phpDocumentor.phar run -d src -t docs
5858
- run: |
59-
diff=$(git --no-pager diff --name-only HEAD)
60-
echo "DIFF_IS_EMPTY=$([[ -z "$diff" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
59+
diff_files=$(git --no-pager diff --name-only)
60+
diff_excluding_submodule=$(echo "$diff_files" | grep -v '^line-openapi$' || true)
61+
62+
echo "diff files: $diff_files"
63+
echo "diff excluding submodule: $diff_excluding_submodule"
64+
65+
echo "DIFF_IS_EMPTY=$([[ -z "$diff_excluding_submodule" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
6166
echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
6267
## Run if diff exists and pull request, and make CI status failure (but allow renovate bot)
6368
- if: ${{ github.event_name == 'pull_request' && env.DIFF_IS_EMPTY != 'true' && github.actor != 'renovate[bot]' }}

0 commit comments

Comments
 (0)