Skip to content

Commit

Permalink
PRをgit merge --ff-onlyできるようにする (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip authored Apr 26, 2023
1 parent 297c6c7 commit 924523e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ close #0
-->

## その他

<!--
VOICEVOX/voicevox_coreの変更を取り込むときだけこのチェックボックスに`x`を付けます。
このチェックボックスをチェックしても強制力が発生したりしないので、GitHubのUIで間違えて「通常のマージ」をしないように気を付ける必要があります。
CIが通ってレビューも完了してからラベル`ff-merge`を手動で付けると、ワークフロー`FF merge`が作動して`--ff-only`のマージが行われます。
-->
- [ ] 本PRは`--ff-only`でマージする。GitHubのUIでマージされるべきではない
35 changes: 35 additions & 0 deletions .github/workflows/ff-merge.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 924523e

Please sign in to comment.