wei / pull

🤖 Keep your forks up-to-date via automated PRs

Home Page:https://github.com/apps/pull

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rather than specifying `main`, can I specify the default branch?

paddyroddy opened this issue · comments

In GitHub rulesets, you can specify a default branch (i.e. main) https://github.com/paddyroddy/.github/blob/28fd159e789efb8205954d5a36276157c66c8534/renovate/README.md?plain=1#L73. In GitHub Safe Settings you can too https://github.com/github/safe-settings/blob/e584dbc552df2674186d61c7a17c040dafade634/README.md?plain=1#L444-L445.

Would it be possible to do something like:

version: "1"
rules:
  - base: default
    upstream: wei:default
    mergeMethod: hardreset

In our Basic Setup, pull actually does detect the default branch of the upstream and merge into yours of the same name:

const defaultBranch = repoInfo.data.parent.default_branch

I do recognize you may have a different name for your default branch vs upstream's default branch but I believe that is an edge case worth of writing out a config for with the precise branch names to avoid confusion.

Do you have other use-cases you can think of?

Hadn't realised that's what the basic setup does. But if you want to set any other config, then you need a config file and hence lose that basic config behaviour - is that correct?

To be honest that is the same as I was thinking. Personally when I make a fork I usually like to rename the default branch main to get into the habit. Even if that does mean it differs from the upstream.

Plus in the event that the upstream did rename their default branch for whatever reason, then your config isn't broken.

Correct, if the Basic config doesn't satisfy your needs, a config file is required.

I don't think renaming of the default branch is frequent enough for us to code for.