Sync with Master
A config to keep every PR up-to-date with master. Whenever the target branch of a PR updates, the PR will update.
# .kodiak.toml version = 1 [update] always = true # default: false require_automerge_label = false # default: true
Automated dependency updates with Dependabot
Kodiak can automerge Dependabot PRs without human intervention by configuring Dependabot to open pull requests with our
Configuring Dependabot with the automerge label
Install Kodiak following the quick start guide.
# dependabot.yml # Specify labels for pull requests version: 2 updates: - package-ecosystem: "npm" directory: "/" schedule: interval: "daily" labels: - "dependencies" # Add default Kodiak `merge.automerge_label` - "automerge"
- Success! Dependabot PRs will now include your automerge label, triggering Kodiak to automatically merge them. 🎉
Adding pull request approvals to Dependabot pull requests
When "Required approving reviews" is configured via GitHub Branch Protection, every pull request needs an approving review before it can be merged.
Kodiak can add an approval to pull requests via
approve.auto_approve_usernames, enabling Dependabot PRs to be merged without human intervention.
NOTE: Remove the
[bot]suffix from GitHub Bot usernames. Instead of
# .kodiak.toml version = 1 [approve] # note: remove the "[bot]" suffix from GitHub Bot usernames. # Instead of "dependabot[bot]" use "dependabot". auto_approve_usernames = ["dependabot"] # if using `update.always`, add dependabot to the blacklist to allow # dependabot to update and close stale dependency upgrades. [update] ignored_usernames = ["dependabot"]
If you use Kodiak with
update.always enabled, add Dependabot to the
update.ignored_usernames list. If a PR by Dependabot is updated by another user, Dependabot will not update or close the PR when stale. This setting prevents Kodiak from breaking Dependabot PRs.
This is the config used by the Kodiak repository.
We squash all PR commits and use the PR title and body for the merge commit. Once merged, we delete the PR's branch.
# .kodiak.toml version = 1 [merge] method = "squash" # default: "merge" delete_branch_on_merge = true # default: false [merge.message] title = "pull_request_title" # default: "github_default" body = "pull_request_body" # default: "github_default"
Efficiency and Speed
This config prioritizes resource conservation by only updating a PR when it is ready to merge and favors speed by immediately merging any PR that is ready to merge.
merge.prioritize_ready_to_merge would improve fairness by ensuring a first-come-first-served policy for the merge queue.
# .kodiak.toml version = 1 [merge] # don't wait for running status checks when a PR needs update. optimistic_updates = true # default: true # if a PR is ready, merge it, don't place it in the merge queue. prioritize_ready_to_merge = true # default: false
Better Merge Messages
GitHub's default merge commits are ugly. GitHub uses the title of the first commit for the merge title and combines all of the other commit titles and bodies for the merge body.
Using the pull request title and body give a cleaner, more useful merge commit.
This config uses the PR title and body, along with the PR number to create a nice merge commit. Additionally we strip HTML comments from the PR markdown body which can be useful if your GitHub repo has PR templates.
# .kodiak.toml version = 1 [merge.message] # use title of PR for merge commit. title = "pull_request_title" # default: "github_default" # use body of PR for merge commit. body = "pull_request_body" # default: "github_default" # add the PR number to the merge commit title, like GitHub. include_pr_number = true # default: true # use the default markdown content of the PR for the merge commit. body_type = "markdown" # default: "markdown" # remove html comments to auto remove PR templates. strip_html_comments = true # default: false