Jsdelivr: Feature: github link should use default branch, not master branch

Created on 17 Aug 2020  路  5Comments  路  Source: jsdelivr/jsdelivr

Does the github link without a branch specified, for example https://cdn.jsdelivr.net/gh/markedjs/marked/lib/marked.js, use the default branch or is hardcoded to the master branch?

enhancement normal priority

All 5 comments

master regardless of the GitHub settings

I see.

Then consider this a feature request to change it to the repo's default branch 馃檪

Also note that GitHub is going to be changing the default branch for new repos in the future: https://github.com/github/renaming

I'll keep this open to consider later but in the end we may just decide to recommend using explicit branch names. Resolving this dynamically per repository is probably something we would like to avoid.

Today I found that GitHub supports @HEAD references, which seem to point to the default branch, e.g. https://github.com/ractivejs/ractive/blob/HEAD/package.json.

However, I couldn't find anything at all in GitHub docs about it. If anyone finds a resource that confirms this is intended behavior that is safe to rely on, it'll definitely help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Drew233 picture Drew233  路  8Comments

SukkaW picture SukkaW  路  3Comments

flopanzer picture flopanzer  路  4Comments

miyurusankalpa picture miyurusankalpa  路  7Comments

iskitz picture iskitz  路  9Comments