Skip to content

TypeError: Issuer (iss) must be a string when using GitHub App authentication #333

@timdittler

Description

@timdittler

Description

When using GitHub App authentication, the action fails with a TypeError because the app_id is passed as an integer to PyJWT, which now requires the iss claim to be a string.

Error

Traceback (most recent call last):
  File "/action/workspace/cleanowners.py", line 340, in <module>
    main()
  File "/action/workspace/cleanowners.py", line 42, in main
    github_connection = auth.auth_to_github(
  File "/action/workspace/auth.py", line 33, in auth_to_github
    gh.login_as_app_installation(
  File "/usr/local/lib/python3.14/site-packages/github3/github.py", line 1516, in login_as_app_installation
    jwt_token = apps.create_token(
  File "/usr/local/lib/python3.14/site-packages/github3/apps.py", line 175, in create_token
    token = jwt.encode(
        payload={"iat": now, "exp": now + expire_in, "iss": app_id},
        ...
    )
  File "/usr/local/lib/python3.14/site-packages/jwt/api_jwt.py", line 145, in encode
    raise TypeError("Issuer (iss) must be a string.")
TypeError: Issuer (iss) must be a string.

Root Cause

This is a known issue in github3.py v4.0.1, which is pinned in this action's requirements.txt. The fix has been merged upstream:

However, no new release of github3.py has been published since v4.0.1 (April 2023).

Suggested Fix

Either:

  1. Pin github3.py to the commit with the fix (b7cf6114c76f9a731e44572a24d531645c3a3e85)
  2. Wait for a new github3.py release and update requirements.txt

Environment

  • Action version: v1.2.13 / v1.3.0
  • Docker image: ghcr.io/github/cleanowners:v1
  • Python version in image: 3.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions