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

add: merge-gatekeeperの設定方法を追加 #59

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Changes from 1 commit
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
51 changes: 49 additions & 2 deletions docs/雑多なメモ.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,49 @@
* Organization secrets/variables
* `DISCORD_WEBHOOK_URL`: VOICEVOX非公式Discordの`#github`へチャンネルに届くwebhook url
## Organization secrets/variables

- `DISCORD_WEBHOOK_URL`: VOICEVOX 非公式 Discord の`#github`へチャンネルに届く webhook url
- `GATEKEEPER_TOKEN`: [`merge-gatekeeper`](https://github.com/VOICEVOX/merge-gatekeeper)に必要なトークン

## Auto merge & merge queue

[`merge-gatekeeper`](https://github.com/VOICEVOX/merge-gatekeeper)を活用することで、VOICEVOX レビューの複雑なマージ可能判定を反映しつつ、オートマージ・マージキューを設定できます。

`.github/workflows/merge_gatekeeper.yml`に以下のような Github workflow ファイルを作ります。
`required_score`や`score_rules`、kebab-case にするかなどはリポジトリのルールに合わせます。

```yaml
name: "Merge Gatekeeper"

# auto mergeとmerge queue用のチェッカー。
# Approve数が足りているか、すべてのテストが通っているかを確認します。
# 詳細: https://github.com/VOICEVOX/merge-gatekeeper

on:
pull_request_target:
types: [auto_merge_enabled]
merge_group:
types: [checks_requested]

jobs:
merge_gatekeeper:
runs-on: ubuntu-latest
steps:
- uses: voicevox/merge-gatekeeper@main
with:
token: ${{ secrets.GATEKEEPER_TOKEN }}
required_score: 2
score_rules: |
#maintainer: 2
#reviewer: 1
- uses: upsidr/merge-gatekeeper@v1
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
with:
token: ${{ secrets.GITHUB_TOKEN }}
self: merge_gatekeeper
# https://github.com/upsidr/merge-gatekeeper/issues/71#issuecomment-1660607977
ref: ${{ github.event.pull_request && github.event.pull_request.head.sha || github.ref }}
timeout: 18000 # 5 hours
```

ワークフローファイルを作った後に一度メインブランチにマージします。

リポジトリの設定の Allow auto-merge を有効にし、
[`merge-gatekeeper`](https://github.com/VOICEVOX/merge-gatekeeper)の Ruleset をエクスポートしてリポジトリにインポートすれば設定完了です。