alexellis / derek

Reduce maintainer fatigue by automating GitHub
https://github.com/alexellis/derek/blob/master/USER_GUIDE.md
MIT License
806 stars 72 forks source link

Detect repository default branch #168

Closed angelbarrera92 closed 2 years ago

angelbarrera92 commented 3 years ago

Expected Behaviour

I expect derek to look for its configuration file on the default branch of the repository instead of master. GitHub changed its default branch from master to main, it is difficult to debug this issue if you don't run derek self-hosted.

Current Behaviour

derek looks for the .DEREK.yml file in the root of the project in the master branch.

Possible Solution

Identify what is the default branch of the repository, then look for the configuration file on that branch.

Steps to Reproduce (for bugs)

  1. Create a new repository
  2. Setup derek in the default branch
  3. Create a GitHub issue on the new repository
  4. Add a comment requesting derek to add a label

Context

During some derek modifications, I found this issue. Thanks that I self-hosted it I was able to find the misconfiguration in my repository.

Your Environment

or

jolheiser commented 3 years ago

@alexellis Hello! 👋

I would like to contribute to this issue. The webhook payload actually should contain the repository's default branch, so that should be easy enough to work with.

Anything you want me to consider, or does that all sound alright with you?

alexellis commented 3 years ago

Hi @jolheiser

What approach do you think would make sense?

If this can be done without using up API calls, I'd be interested in a draft PR for discussion.

Alex

jolheiser commented 3 years ago

This was resolved by #174

Thanks again @cpanato @alexellis !

rgee0 commented 2 years ago

Derek close: Fixed in #174