github / docs

The open-source repo for docs.github.com
https://docs.github.com
Creative Commons Attribution 4.0 International
16.02k stars 59.07k forks source link

Dependabot yml `commit-message` prefs also impact PR titles #33995

Closed janbrasna closed 3 weeks ago

janbrasna commented 1 month ago

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#commit-message

What part(s) of the article would you like to see updated?

The commit-message settings also impact PR titles — there's no mention in and around this config section (might be elsewhere, wasn't able to find it explained anywhere) so it'd be worth adding not only commits change, but also the effective PR titles.

Additionally there's no info how to change PR titles (= i.e. mention it's always populated based on the commit messages, either explicitly set or auto-detected from the repo history…)

Additional information

I wanted to change the format of Dependabot PR titles to pre-populate the correct form for squash merging and couldn't find any configuration for it. Only randomly found out the titles match the commits, therefore setting the commit-message pref also sets the PR title. This is not explained in the docs, and neither is a mention of how to change the format of the PR title for those who don't care about commit messages, but look for customising the PR titles. The setting does both (and is the only place for it.) = i.e. titles and commit messages are always to be set to the same style.

nguyenalex836 commented 1 month ago

@janbrasna Thanks so much for opening an issue! I'll get this triaged for review ✨

github-actions[bot] commented 1 month ago

Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes:

mchammer01 commented 3 weeks ago

@janbrasna - Thanks for raising this ✨

I asked the Dependabot team about this and you are absolutely right. The commit prefix is added to the start of the PR title: https://github.com/dependabot/dependabot-core/blob/e8f477a63162bfcf5ad65d2e2155e54[…]/common/lib/dependabot/pull_request_creator/pr_name_prefixer.rb.

I'll add a help-wanted label so that anyone can raise a pull request to mention this in our docs, as well as information on how to change PR titles.