From 9531ec10448337d84d99761c6c5e5f63586571da Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Wed, 15 Jan 2025 17:50:51 +0900 Subject: [PATCH] Set title and description written in line-openapi PR again (#741) same as https://github.com/line/line-bot-sdk-nodejs/pull/1123 --- .github/workflows/generated-code.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/generated-code.yml b/.github/workflows/generated-code.yml index 9aa31d61..97acd510 100644 --- a/.github/workflows/generated-code.yml +++ b/.github/workflows/generated-code.yml @@ -39,17 +39,7 @@ jobs: ## 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: | - BRANCH_NAME="update-diff-${{ env.CURRENT_DATETIME }}" - - git config user.name github-actions - git config user.email github-actions@github.com - git checkout -b $BRANCH_NAME - - git add . - git commit -m "Code are generated by openapi generator" - - git push origin $BRANCH_NAME - + # Determine Change Type via Submodule Script. This scripts read current uncommited changes. CHANGE_TYPE=$(npx zx ./line-openapi/tools/determine-change-type.mjs) echo "Determined change type: $CHANGE_TYPE" @@ -66,6 +56,18 @@ jobs: BODY="⚠Reviewer: Please edit this description to include relevant information about the changes.⚠" fi + # Create PR + BRANCH_NAME="update-diff-${{ env.CURRENT_DATETIME }}" + + git config user.name github-actions + git config user.email github-actions@github.com + git checkout -b $BRANCH_NAME + + git add . + git commit -m "Code are generated by openapi generator" + + git push origin $BRANCH_NAME + gh pr create -B ${{ github.ref_name }} -H $BRANCH_NAME -t "$TITLE" -b "$BODY" --label "line-openapi-update" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}