Skip to content

Commit d28f3bb

Browse files
authored
Skip creating PR when only git submodule is updated (#784)
same as line/line-bot-sdk-nodejs#1210
1 parent 9e5bad5 commit d28f3bb

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.github/workflows/generate-code.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ jobs:
2121
- name: Update submodules
2222
run: git submodule update --remote --recursive
2323
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
24-
- name: Set up Python
25-
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
26-
with:
27-
python-version: '3.x'
2824
- name: Generate code
29-
run: |
30-
python generate-code.py
31-
diff=$(git --no-pager diff --name-only HEAD)
32-
echo "DIFF_IS_EMPTY=$([[ -z "$diff" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
25+
run: python generate-code.py
26+
- run: |
27+
diff_files=$(git --no-pager diff --name-only)
28+
diff_excluding_submodule=$(echo "$diff_files" | grep -v '^line-openapi$' || true)
29+
30+
echo "diff files: $diff_files"
31+
echo "diff excluding submodule: $diff_excluding_submodule"
32+
33+
echo "DIFF_IS_EMPTY=$([[ -z "$diff_excluding_submodule" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
3334
echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
3435
## Run if diff exists and pull request, and make CI status failure (but allow renovate bot)
3536
- if: ${{ github.event_name == 'pull_request' && env.DIFF_IS_EMPTY != 'true' && github.actor != 'renovate[bot]' }}

0 commit comments

Comments
 (0)