File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -331,13 +331,20 @@ def post_pr_summary(self, pr_number: int) -> None:
331331def main ():
332332 """Main entry point for the bot."""
333333 # Get environment variables
334- github_token = os .getenv ("GITHUB_TOKEN" )
334+ # Prefer FANEX_BOT_TOKEN (GitHub App token) if available, otherwise use GITHUB_TOKEN
335+ github_token = os .getenv ("FANEX_BOT_TOKEN" ) or os .getenv ("GITHUB_TOKEN" )
335336 repo_name = os .getenv ("GITHUB_REPOSITORY" )
336337 event_path = os .getenv ("GITHUB_EVENT_PATH" )
337338
338339 if not github_token or not repo_name :
339- print ("Error: GITHUB_TOKEN and GITHUB_REPOSITORY must be set" )
340+ print ("Error: FANEX_BOT_TOKEN or GITHUB_TOKEN and GITHUB_REPOSITORY must be set" )
340341 sys .exit (1 )
342+
343+ # Log which token is being used (for debugging)
344+ if os .getenv ("FANEX_BOT_TOKEN" ):
345+ print ("ℹ️ Using FANEX_BOT_TOKEN - comments will appear as faneX-ID Bot" )
346+ else :
347+ print ("ℹ️ Using GITHUB_TOKEN - comments will appear as github-actions[bot]" )
341348
342349 # Add current directory to path for imports
343350 bot_dir = os .path .dirname (os .path .abspath (__file__ ))
You can’t perform that action at this time.
0 commit comments