metrics
metrics copied to clipboard
fix(app/metrics): private repositories may be always ignored
A lot of users seems to report that their private repositories are not taken into account, even with a repo
scope
I've noticed that the "Most Used Languages" stats for my metrics are weird, while the basic stats look good.It only analyzed 86 commits from thousand commits.
When plugin_languages_indepth
is enabled, private repositories cannot be cloned even if a token is provided and access is enabled.
The action log of debug: yes
as follows:
metrics/compute/XXX/plugins > languages > indepth analyzer > failed to clone https://github.com/XXX/REPO(Error: Cloning into '.'...
fatal: could not read Username for 'https://github.com/': No such device or address
)
I'm not sure the relationship between them, but I just want to provide some cues for this bug. Thanks for your awesome work!
Hi, I'm trying to set up actions for my own profile and I also ran into the same issues. I took a quick look at the code and the issues seems to be that no token is passed when cloning a repo, causing clones to all private repos to fail:
https://github.com/lowlighter/metrics/blob/master/source/plugins/languages/analyzer/analyzer.mjs#L94
According to this Stackoverflow post, all you need to do is change the URL to include the token.
Encountering the same issue myself
Just created a PR to fix this: https://github.com/lowlighter/metrics/pull/1579