Skip to content

Commit af4a889

Browse files
authored
Skip create PR when only git submodule is updated (#1210)
Even when only the submodule is updated and the code is not, a PR is created in the bot SDK repository.(like #1208) If there is no diff in the generated code, I think it's sufficient for Renovate to update the submodule version without creating a PR through the GitHub Actions workflow. Therefore, this change excludes the submodule from the PR creation conditions and CI failure conditions.
1 parent 1054858 commit af4a889

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/generate-code.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
id: setup_node_id
2626
with:
2727
node-version: 18
28-
- name: actions/setup-java@v3
28+
- name: Set up Java
2929
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
3030
with:
3131
distribution: 'temurin'
@@ -39,8 +39,13 @@ jobs:
3939
- name: Generate code
4040
run: python3 generate-code.py
4141
- run: |
42-
diff=$(git --no-pager diff --name-only)
43-
echo "DIFF_IS_EMPTY=$([[ -z "$diff" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
42+
diff_files=$(git --no-pager diff --name-only)
43+
diff_excluding_submodule=$(echo "$diff_files" | grep -v '^line-openapi$' || true)
44+
45+
echo "diff files: $diff_files"
46+
echo "diff excluding submodule: $diff_excluding_submodule"
47+
48+
echo "DIFF_IS_EMPTY=$([[ -z "$diff_excluding_submodule" ]] && echo 'true' || echo 'false')" >> $GITHUB_ENV
4449
echo "CURRENT_DATETIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
4550
## Run if diff exists and pull request, and make CI status failure (but allow renovate bot)
4651
- if: ${{ github.event_name == 'pull_request' && env.DIFF_IS_EMPTY != 'true' && github.actor != 'renovate[bot]' }}

0 commit comments

Comments
 (0)