Skip to content

Fix GitHub Notifications plugin to support modern PAT tokens#2152

Open
ywzheng1 wants to merge 1 commit intomatryer:mainfrom
ywzheng1:ywzheng1/github-notification-token-len-fix
Open

Fix GitHub Notifications plugin to support modern PAT tokens#2152
ywzheng1 wants to merge 1 commit intomatryer:mainfrom
ywzheng1:ywzheng1/github-notification-token-len-fix

Conversation

@ywzheng1
Copy link

Summary

This PR fixes the GitHub Notifications xbar plugin rejecting valid GitHub personal access tokens.

Background

The plugin currently checks for tokens using len(token) == 40, which worked for classic PATs but no longer works with modern GitHub personal access tokens (e.g. github_pat_...) that are longer and now recommended by GitHub.

As a result, valid tokens are silently ignored and the plugin shows only a dot.

Changes

  • Accept any non-empty GITHUB_TOKEN instead of assuming a fixed length
  • Convert regex strings to raw strings to avoid Python SyntaxWarnings

Compatibility

  • Classic 40-character tokens continue to work
  • No behavior change when no token is set
  • No API or UI changes

Testing

  • Tested with classic PAT
  • Tested with modern fine-grained github_pat_... token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant