diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml new file mode 100644 index 0000000000..58b40697c8 --- /dev/null +++ b/.github/workflows/auto-merge.yml @@ -0,0 +1,36 @@ +name: Auto-merge + +on: + workflow_run: + workflows: [E2E testing for EC-CUBE] + types: [completed] + +jobs: + check-and-merge: + runs-on: ubuntu-latest + if: | + github.event.workflow_run.conclusion == 'success' + permissions: + pull-requests: write + contents: write + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Approve PR + run: gh pr review "$PR_URL" --approve + ## いきなりマージするのが怖いので、一旦自動承認(↑)だけにする + #- name: Enable auto-merge + # run: gh pr merge --merge --auto "$PR_URL" + + failed: + runs-on: ubuntu-latest + if: | + github.event.workflow_run.conclusion == 'failure' + steps: + - name: failed + # 失敗したときにデバッグ用に情報を出力しておく + run: | + echo 'Haven't met the conditions to merge yet' + echo '${{ toJSON(github.event.workflow_run) }}' + exit 1 \ No newline at end of file diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 34c9b3dce1..dac9fd444e 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -1,21 +1,17 @@ name: E2E testing for EC-CUBE +run-name: E2E testing for EC-CUBE + on: - push: - branches: - - '*' - tags: - - '*' - paths: - - '**' - - '!*.md' - pull_request: - paths: - - '**' - - '!*.md' + workflow_run: + workflows: [CI/CD for EC-CUBE] + types: [completed] + jobs: run-on-linux: name: Run on Linux runs-on: ubuntu-22.04 + if: | + github.event.workflow_run.conclusion == 'success' strategy: fail-fast: false matrix: @@ -85,6 +81,8 @@ jobs: installer: name: Installer test runs-on: ubuntu-22.04 + if: | + github.event.workflow_run.conclusion == 'success' strategy: fail-fast: false matrix: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0d33224d88..cc4ef800e7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,21 +1,17 @@ name: CI/CD for EC-CUBE +run-name: CI/CD for EC-CUBE + on: - push: - branches: - - '*' - tags: - - '*' - paths: - - '**' - - '!*.md' - pull_request: - paths: - - '**' - - '!*.md' + workflow_run: + workflows: [PHPStan] + types: [completed] + jobs: run-on-linux: name: Run on Linux runs-on: ${{ matrix.operating-system }} + if: | + github.event.workflow_run.conclusion == 'success' strategy: fail-fast: false matrix: @@ -150,6 +146,8 @@ jobs: run-on-windows: name: Run on Windows runs-on: ${{ matrix.operating-system }} + if: | + github.event.workflow_run.conclusion == 'success' strategy: fail-fast: false matrix: diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 1564e9aa39..19950eb471 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -1,4 +1,6 @@ name: PHPStan +run-name: PHPStan + on: push: branches: @@ -12,6 +14,8 @@ on: paths: - '**' - '!*.md' + pull_request_review: + types: [submitted] jobs: phpstan: