Skip to content

Commit

Permalink
fix: fixes empty token error in entrypoint and logs and error for the…
Browse files Browse the repository at this point in the history
… use case

Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Jul 10, 2023
1 parent d9be5c3 commit 11cd5e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ else
exit 1
fi

command+=" --with-token <<<\"${GITHUB_TOKEN}\""
command+=" --with-token - <<<\"${GITHUB_TOKEN}\""
fi

exec 3>&1
Expand Down
6 changes: 5 additions & 1 deletion trestlebot/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@ def run() -> None:
)
sys.exit(1)

git_provider = GitHub(access_token=args.with_token)
if not args.with_token:
logger.error("with-token value cannot be empty")
sys.exit(1)

git_provider = GitHub(access_token=args.with_token.read().strip())

exit_code: int = 0

Expand Down

0 comments on commit 11cd5e9

Please sign in to comment.