Skip to content

Fail when token env var is set but invalid #20

@SHxKM

Description

@SHxKM

Right now I'm investigating why no comitters are shown at all in production (via GitHub pages) while the plugin works flawlessly locally (through serve and with build --strict).

I'm presuming this is because I'm doing something wrong here (action snippet):

- name: Build docs
  run: uv run mkdocs build --strict
  env:
    MKDOCS_GIT_APIKEY: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy docs
  run: uv run mkdocs gh-deploy --force
  env:
    MKDOCS_GIT_APIKEY: ${{ secrets.GITHUB_TOKEN }}

I see this in the action output logs:

INFO    -  git-committers plugin ENABLED
INFO    -  DeprecationWarning: Argument login_or_token is deprecated, please use auth=github.Auth.Token(...) instead

The name matches in mkdocs.yml:

plugins:
	- git-committers:
    	repository: upwindsecurity/kb-backend
      	branch: main
        token: !!python/object/apply:os.getenv ["MKDOCS_GIT_APIKEY"] # GitHub API token for fetching committers

It'd be nice if the plugin threw an error when the env var it's looking for is there but is invalid.

Edit: or maybe this plugin does not support using a token from the action...?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions