From b808ca1126197a40fc74c3fb2c61ea2a74366ce5 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Mon, 7 Apr 2025 11:16:10 +0900 Subject: [PATCH 01/12] NO-ISSUE Require more jobs in merge queue --- .github/workflows/ci.yml | 4 ++-- .github/workflows/sdk-testing.yml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 668a5ae..5738b50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: Basic CI on: push: - branches: [ "main" ] pull_request: - branches: [ "main" ] + merge_group: + workflow_dispatch: jobs: setup: diff --git a/.github/workflows/sdk-testing.yml b/.github/workflows/sdk-testing.yml index ad14a76..fb30798 100644 --- a/.github/workflows/sdk-testing.yml +++ b/.github/workflows/sdk-testing.yml @@ -1,9 +1,10 @@ name: SDK Test Automation on: + push: pull_request: - branches: - - main + merge_group: + workflow_dispatch: jobs: test-java: From 2f85b2a96b71fc36a01eea6a980ab9a336ee0610 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Mon, 7 Apr 2025 11:32:33 +0900 Subject: [PATCH 02/12] NO-ISSUE fix --- .github/workflows/sdk-testing.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/sdk-testing.yml b/.github/workflows/sdk-testing.yml index fb30798..7a9f96d 100644 --- a/.github/workflows/sdk-testing.yml +++ b/.github/workflows/sdk-testing.yml @@ -2,7 +2,11 @@ name: SDK Test Automation on: push: + branches: + - main pull_request: + branches: + - main merge_group: workflow_dispatch: From 82d25a221be789bc1232a7ee05bab5df0d2dc460 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Mon, 7 Apr 2025 13:06:17 +0900 Subject: [PATCH 03/12] NO-ISSUE Disable merge queue for sdk-testing and leave inline comment --- .github/workflows/sdk-testing.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sdk-testing.yml b/.github/workflows/sdk-testing.yml index 7a9f96d..b226019 100644 --- a/.github/workflows/sdk-testing.yml +++ b/.github/workflows/sdk-testing.yml @@ -1,14 +1,13 @@ name: SDK Test Automation on: - push: - branches: - - main pull_request: branches: - main - merge_group: - workflow_dispatch: + ## This workflow is only for testing remote bot sdk repositories. We don't have to run this workflow for the main repository. + # merge_group: + # push: + # workflow_dispatch jobs: test-java: From 44f724f1c6cddee32e6ad7aca2baf3587f911417 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Mon, 7 Apr 2025 13:38:00 +0900 Subject: [PATCH 04/12] NO-ISSUE fix --- .github/workflows/sdk-testing.yml | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sdk-testing.yml b/.github/workflows/sdk-testing.yml index b226019..54d62b3 100644 --- a/.github/workflows/sdk-testing.yml +++ b/.github/workflows/sdk-testing.yml @@ -1,13 +1,14 @@ name: SDK Test Automation on: + push: + branches: + - main pull_request: branches: - main - ## This workflow is only for testing remote bot sdk repositories. We don't have to run this workflow for the main repository. - # merge_group: - # push: - # workflow_dispatch + merge_group: + workflow_dispatch: jobs: test-java: @@ -22,16 +23,30 @@ jobs: repository: 'line/line-bot-sdk-java' submodules: recursive - - name: Update line-openapi submodule + - name: Update line-openapi submodule (only when pull request) + if: ${{ github.event_name == 'pull_request' }} run: | cd line-openapi - git remote add pr-source $PR_REPO_URL - git fetch pr-source $PR_REF - git checkout FETCH_HEAD + + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "This is a pull request event" + git remote add pr-source $PR_REPO_URL + git fetch pr-source $PR_REF + git checkout FETCH_HEAD + fi env: PR_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }} PR_REF: ${{ github.event.pull_request.head.ref }} + - name: Update line-openapi submodule (not when pull request) + if: ${{ github.event_name != 'pull_request' }} + run: | + cd line-openapi + + echo "This is ${ github.event_name } event" + git checkout main + git pull origin main + # https://github.com/line/line-bot-sdk-java/blob/master/.github/workflows/gradle.yml - name: Setup Java uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 From 6278ddec017d793cd7ceebf1efad9e65890540df Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Mon, 7 Apr 2025 13:39:04 +0900 Subject: [PATCH 05/12] NO-ISSUE fix2 --- .github/workflows/sdk-testing.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sdk-testing.yml b/.github/workflows/sdk-testing.yml index 54d62b3..493ea44 100644 --- a/.github/workflows/sdk-testing.yml +++ b/.github/workflows/sdk-testing.yml @@ -27,13 +27,11 @@ jobs: if: ${{ github.event_name == 'pull_request' }} run: | cd line-openapi - - if [ "${{ github.event_name }}" = "pull_request" ]; then - echo "This is a pull request event" - git remote add pr-source $PR_REPO_URL - git fetch pr-source $PR_REF - git checkout FETCH_HEAD - fi + + echo "This is a pull request event" + git remote add pr-source $PR_REPO_URL + git fetch pr-source $PR_REF + git checkout FETCH_HEAD env: PR_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }} PR_REF: ${{ github.event.pull_request.head.ref }} From e84c5a4c3f2af37a6a5ee8884ea9dc1863e12671 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Mon, 7 Apr 2025 13:58:38 +0900 Subject: [PATCH 06/12] NO-ISSUE test --- .github/workflows/sdk-testing.yml | 40 +++++-------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/.github/workflows/sdk-testing.yml b/.github/workflows/sdk-testing.yml index 493ea44..d39856a 100644 --- a/.github/workflows/sdk-testing.yml +++ b/.github/workflows/sdk-testing.yml @@ -23,27 +23,10 @@ jobs: repository: 'line/line-bot-sdk-java' submodules: recursive - - name: Update line-openapi submodule (only when pull request) - if: ${{ github.event_name == 'pull_request' }} - run: | - cd line-openapi - - echo "This is a pull request event" - git remote add pr-source $PR_REPO_URL - git fetch pr-source $PR_REF - git checkout FETCH_HEAD - env: - PR_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }} - PR_REF: ${{ github.event.pull_request.head.ref }} - - - name: Update line-openapi submodule (not when pull request) - if: ${{ github.event_name != 'pull_request' }} - run: | - cd line-openapi - - echo "This is ${ github.event_name } event" - git checkout main - git pull origin main + - name: Update line-openapi submodule + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + path: './line-openapi' # https://github.com/line/line-bot-sdk-java/blob/master/.github/workflows/gradle.yml - name: Setup Java @@ -82,20 +65,9 @@ jobs: submodules: recursive - name: Update line-openapi submodule - run: | - cd line-openapi - git remote add pr-source $PR_REPO_URL - git fetch pr-source $PR_REF - git checkout FETCH_HEAD - env: - PR_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }} - PR_REF: ${{ github.event.pull_request.head.ref }} - - # https://github.com/line/line-bot-sdk-python/blob/master/.github/workflows/auto-testing.yml - - name: Setup Python - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: - python-version: '3.11' + path: './line-openapi' - name: Install dependencies run: | From 21ec8e47caa0a003c7004f0ee5c1618d088a4ee8 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Mon, 7 Apr 2025 14:00:05 +0900 Subject: [PATCH 07/12] NO-ISSUE test data --- webhook.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webhook.yml b/webhook.yml index fa72a60..afa6ef4 100644 --- a/webhook.yml +++ b/webhook.yml @@ -503,6 +503,9 @@ components: type: string description: |+ Message ID of a quoted message. Only included when the received message quotes a past message. + hello: + type: string + default: aaaa this is test. # https://developers.line.biz/en/reference/messaging-api/#unsend-event UnsendEvent: From 6f8ccafe2f31537af0dd1074c6a2648233ac5bfd Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Mon, 7 Apr 2025 14:15:46 +0900 Subject: [PATCH 08/12] NO-ISSUE apply changes to other jobs --- .github/workflows/sdk-testing.yml | 33 +++++++++---------------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/.github/workflows/sdk-testing.yml b/.github/workflows/sdk-testing.yml index d39856a..ffa8bd5 100644 --- a/.github/workflows/sdk-testing.yml +++ b/.github/workflows/sdk-testing.yml @@ -104,14 +104,9 @@ jobs: submodules: recursive - name: Update line-openapi submodule - run: | - cd line-openapi - git remote add pr-source $PR_REPO_URL - git fetch pr-source $PR_REF - git checkout FETCH_HEAD - env: - PR_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }} - PR_REF: ${{ github.event.pull_request.head.ref }} + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + path: './line-openapi' # https://github.com/line/line-bot-sdk-php/blob/master/.github/workflows/php-checks.yml - name: Setup PHP @@ -183,14 +178,9 @@ jobs: submodules: recursive - name: Update line-openapi submodule - run: | - cd line-openapi - git remote add pr-source $PR_REPO_URL - git fetch pr-source $PR_REF - git checkout FETCH_HEAD - env: - PR_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }} - PR_REF: ${{ github.event.pull_request.head.ref }} + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + path: './line-openapi' # https://github.com/line/line-bot-sdk-nodejs/blob/master/.github/workflows/test.yml - name: Setup Java @@ -238,14 +228,9 @@ jobs: submodules: recursive - name: Update line-openapi submodule - run: | - cd line-openapi - git remote add pr-source $PR_REPO_URL - git fetch pr-source $PR_REF - git checkout FETCH_HEAD - env: - PR_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }} - PR_REF: ${{ github.event.pull_request.head.ref }} + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + path: './line-openapi' # https://github.com/line/line-bot-sdk-go/blob/master/.github/workflows/go.yml - name: Setup Java From a7b252905a6f8983df039a948d6f36dc967b6745 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Mon, 7 Apr 2025 14:18:01 +0900 Subject: [PATCH 09/12] NO-ISSUE revert change for test --- webhook.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/webhook.yml b/webhook.yml index afa6ef4..fa72a60 100644 --- a/webhook.yml +++ b/webhook.yml @@ -503,9 +503,6 @@ components: type: string description: |+ Message ID of a quoted message. Only included when the received message quotes a past message. - hello: - type: string - default: aaaa this is test. # https://developers.line.biz/en/reference/messaging-api/#unsend-event UnsendEvent: From d547189931aa8ea3538c42357d43e26393ef0b23 Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Mon, 7 Apr 2025 14:18:40 +0900 Subject: [PATCH 10/12] NO-ISSUE remove unnecesary code --- .github/workflows/sdk-testing.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/sdk-testing.yml b/.github/workflows/sdk-testing.yml index ffa8bd5..c21d128 100644 --- a/.github/workflows/sdk-testing.yml +++ b/.github/workflows/sdk-testing.yml @@ -2,11 +2,7 @@ name: SDK Test Automation on: push: - branches: - - main pull_request: - branches: - - main merge_group: workflow_dispatch: From cb85f459738be7389106956012dc8944302e7eed Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Mon, 7 Apr 2025 14:21:09 +0900 Subject: [PATCH 11/12] NO-ISSUE fix --- .github/workflows/sdk-testing.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/sdk-testing.yml b/.github/workflows/sdk-testing.yml index c21d128..efed046 100644 --- a/.github/workflows/sdk-testing.yml +++ b/.github/workflows/sdk-testing.yml @@ -65,6 +65,12 @@ jobs: with: path: './line-openapi' + # https://github.com/line/line-bot-sdk-python/blob/master/.github/workflows/auto-testing.yml + - name: Setup Python + uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: '3.11' + - name: Install dependencies run: | python -m pip install --upgrade pip From f88a011bb4efdf068c169fc2809a624b7f06f63a Mon Sep 17 00:00:00 2001 From: Yuta Kasai Date: Mon, 7 Apr 2025 14:24:36 +0900 Subject: [PATCH 12/12] NO-ISSUE comment to pull request only when event type is pull request --- .github/workflows/sdk-testing.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/sdk-testing.yml b/.github/workflows/sdk-testing.yml index efed046..a730e8a 100644 --- a/.github/workflows/sdk-testing.yml +++ b/.github/workflows/sdk-testing.yml @@ -40,6 +40,7 @@ jobs: git diff --color=always --staged - name: Post PR comment + if : ${{ github.event_name == 'pull_request' }} uses: ./line-openapi/.github/actions/post-comment-action with: language: java @@ -85,6 +86,7 @@ jobs: git diff --color=always --staged - name: Post PR comment + if : ${{ github.event_name == 'pull_request' }} uses: ./line-openapi/.github/actions/post-comment-action with: language: python @@ -159,6 +161,7 @@ jobs: git diff --color=always --staged - name: Post PR comment + if : ${{ github.event_name == 'pull_request' }} uses: ./line-openapi/.github/actions/post-comment-action with: language: php @@ -209,6 +212,7 @@ jobs: git diff --color=always --staged - name: Post PR comment + if : ${{ github.event_name == 'pull_request' }} uses: ./line-openapi/.github/actions/post-comment-action with: language: nodejs @@ -264,6 +268,7 @@ jobs: git diff --color=always --staged - name: Post PR comment + if : ${{ github.event_name == 'pull_request' }} uses: ./line-openapi/.github/actions/post-comment-action with: language: go