Skip to content

try repo default branch when fetching license - #22

Open
jorgeMFS wants to merge 1 commit into
masterfrom
try-default-branch-for-license
Open

jorgeMFS wants to merge 1 commit into
masterfrom
try-default-branch-for-license

Conversation

@jorgeMFS

@jorgeMFS jorgeMFS commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Currently download_github_license only tries main and master for the LICENSE file. Repos whose default branch is
something else (e.g. inab/trimal on trimAl, samtools/bcftools on develop) fall through to the not-found error even when the file is present at HEAD. This queries the GitHub API for the
repo's actual default branch and tries that first, then falls back to main/master. Non-breaking — existing main/master repos hit a single extra API call before the same raw fetch.


Merge order

sbom-implementation is the priority branch and rewrites parts of the builders. This PR conflicts with it on hub/builders/builder.py. Rebase after it lands.

Still needed after that: master hardcodes ["main", "master"] when fetching a licence, which fails for repositories whose default branch is neither — inab/trimal uses trimAl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant