From 429d5cb54e4088e1184e09e6811d2f356fef0825 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Mon, 24 Apr 2023 22:35:37 +0900 Subject: [PATCH] =?UTF-8?q?PR=E3=82=92`git=20merge=20--ff-only`=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/PULL_REQUEST_TEMPLATE.md | 7 +++++++ .github/workflows/ff-merge.yml | 35 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/ff-merge.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d58fd1367..224df74de 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,3 +16,10 @@ close #0 --> ## その他 + + +- [ ] 本PRは`--ff-only`でマージする。GitHubのUIでマージされるべきではない diff --git a/.github/workflows/ff-merge.yml b/.github/workflows/ff-merge.yml new file mode 100644 index 000000000..c79f45e3a --- /dev/null +++ b/.github/workflows/ff-merge.yml @@ -0,0 +1,35 @@ +# PRに手動で`ff-merge`というラベルを付けると、このworkflowが起動して`--ff-only`なマージが行われる。 +# +# VOICEVOX/voicevox_coreの変更を、CIのチェックとレビューを通してかつ単純なコミットログの状態で取り込むことが目的。 +# VOICEVOX/voicevox_coreの`main`を`git merge`したものをPRとして出し、それをこのworkflowでSHAREVOXの`main`に取り込む。 + +name: FF merge +on: + pull_request: + types: + - labeled + +jobs: + merge-upstream: + runs-on: ubuntu-latest + if: github.event.label.name == 'ff-merge' + + steps: + - uses: actions/checkout@v3 + with: + ref: main + submodules: true + + - name: FF merge + shell: bash + run: | + # https://github.com/robotology/gh-action-nightly-merge/pull/13 + git config --global --add safe.directory "$GITHUB_WORKSPACE" + + git remote add target "https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY.git" + + git fetch origin ${{ github.event.pull_request.head.sha }} + git merge --ff-only ${{ github.event.pull_request.head.sha }} + git push target main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}