ojacques / mkdocs-git-committers-plugin-2

MkDocs plugin for displaying a list of GitHub (.com or Enterprise) contributors on each page. Encourages contributions to the documentation!
MIT License
58 stars 21 forks source link

Authors not returned for Github Enterprise #56

Open jesusmah opened 6 months ago

jesusmah commented 6 months ago

Im using the mkdocs-git-committers-plugin-2 version 2.3.0 and it does not seem to be able to properly return the authors for each page...

I can see the plugin working fine in the logs:

INFO    -  Building documentation...
INFO    -  git-committers plugin ENABLED
INFO    -  Cleaning site directory
INFO    -  git-committers: fetching contributors for docs/index.md
INFO    -  git-committers: fetching contributors for docs/contributing.md
INFO    -  git-committers: fetching contributors for docs/openshift/airgap-4-12.md
INFO    -  git-committers: fetching contributors for docs/openshift/devops-exercises-4-12.md
INFO    -  git-committers: fetching contributors for docs/openshift/ipi-4-14.md
INFO    -  git-committers: saving page authors cache file
INFO    -  Documentation built in 5.30 seconds

However, the cache folder in its page-authors.json contains empty authors list:

{"cache_date": "2024-03-20", "page_authors": {"docs/index.md": {"last_commit_date": "2023-10-23", "authors": []}, "docs/contributing.md": {"last_commit_date": "2023-10-23", "authors": []}, "docs/openshift/airgap-4-12.md": {"last_commit_date": "2023-11-09", "authors": []}, "docs/openshift/devops-exercises-4-12.md": {"last_commit_date": "2024-03-08", "authors": []}, "docs/openshift/ipi-4-14.md": {"last_commit_date": "2024-03-06", "authors": []}}}

The github token Im using if plenty of permissions.

mike-19 commented 6 months ago

suspect it could be due to the api_version not defined with the class however the validation in constructing the github URL looks for api_version

jesusmah commented 6 months ago

Hi Mike, thanks for your help. However, I did specify the API version:

- git-committers:
    enterprise_hostname: github.ibm.com
    api_version: v3
    repository: CSM-SPGI/training
    branch: main
    token: !ENV ["GH_TOKEN_MKDOCS"]