Skip to content
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Basic CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
merge_group:
workflow_dispatch:

jobs:
setup:
Expand Down
65 changes: 23 additions & 42 deletions .github/workflows/sdk-testing.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: SDK Test Automation

on:
push:
pull_request:
branches:
- main
merge_group:
workflow_dispatch:

jobs:
test-java:
Expand All @@ -20,14 +21,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 }}
Comment on lines -23 to -30
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a way to make it work only when pull request. This change fixes the checkout way so that it always works as expected.

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
Expand All @@ -45,6 +41,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
Expand All @@ -67,14 +64,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-python/blob/master/.github/workflows/auto-testing.yml
- name: Setup Python
Expand All @@ -96,6 +88,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
Expand All @@ -118,14 +111,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
Expand Down Expand Up @@ -176,6 +164,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
Expand All @@ -198,14 +187,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
Expand All @@ -232,6 +216,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
Expand All @@ -254,14 +239,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
Expand Down Expand Up @@ -293,6 +273,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
Expand Down
Loading