Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自動マージの仕組みを導入 #827

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -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
22 changes: 10 additions & 12 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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:
Expand Down
22 changes: 10 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: PHPStan
run-name: PHPStan

on:
push:
branches:
Expand All @@ -12,6 +14,8 @@ on:
paths:
- '**'
- '!*.md'
pull_request_review:
types: [submitted]

jobs:
phpstan:
Expand Down
Loading