Use repo default branch instead of hard-coded "master"
dannysauer opened this issue · comments
Danny Sauer commented
pull-request-action/pull-request.py
Line 347 in 1cb1956
It probably makes sense to use the relevant API call to fetch the default branch of a repo instead of hard-coding in "master" here. Github made the change last year, and the way to get the value in a shell is
curl -L -H 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
https://api.github.com/repos/${owner}/${repo} \
| jq .default_branch
That should be pretty straightforward to translate into Python. I'll open a PR when I find a few spare minutes if no one else does it first.
Vanessasaurus commented
That's a great idea! Yes, would gladly accept a PR for this update. Thank you @dannysauer !