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 b4f9bcf..63d9752 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: @@ -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 }} + 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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