peterus / platformio_dependabot

MIT License
6 stars 4 forks source link

Pull Request not opened #9

Open JoJos1220 opened 2 weeks ago

JoJos1220 commented 2 weeks ago

Hi,

i am using the dependabot for PlatformIO. I got this error on executing the Github Action:

` [I] Updating 'espressif32@6.7.0' from 6.7.0 to 6.8.1 ... Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/app/platformio_dependabot/main.py", line 50, in main() File "/app/platformio_dependabot/main.py", line 46, in main create_pull_request(github_repo, branch_name, package, config.assignee) File "/app/platformio_dependabot/mygit.py", line 39, in create_pull_request pr = github_repo.create_pull(title=body, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/github/Repository.py", line 1577, in create_pull assert isinstance(base, str), base ^^^^^^^^^^^^^^^^^^^^^ AssertionError: None

`

Unfortunatly, the Branch is successfully created with the name: platformio_dependabot/espressif32/6.8.1 but the pull request is not created... Is there something missing in my repo settings with the security? Or is it not possible due to private repo?

thx

JoJos1220 commented 2 weeks ago

I think i was now able to find my Issue by using the platformIO dependabot: The Issue happens if the get_basse_branch() is called because my branches does not name the default pattern master/main. So, I think the best way to solve this is by overloading or determaining within the called .yml File what is the current branch, and giving the possibility to overload the branch name by a seperate variable.

Can this be done?

def get_base_branch(github_repo: Any): branches = list(github_repo.get_branches()) for branch in branches: if branch.name == "master": return "master" if branch.name == "main": return "main" return None