Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove min length and change docstring #80

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/charm_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class GithubActionsExporterConfig(BaseModel): # pylint: disable=too-few-public-
github_webhook_token: github_webhook_token config.
"""

github_api_token: str = Field(None, min_length=1)
github_org: str = Field(None, min_length=1)
github_api_token: str = Field(None)
github_org: str = Field(None)
github_webhook_token: str = Field(..., min_length=1)

class Config: # pylint: disable=too-few-public-methods
Expand Down
3 changes: 2 additions & 1 deletion src/github_actions_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def is_configuration_valid(state: CharmState) -> bool:
state: The state of the charm.

Returns:
True if they are all set
True if all configs are set, github_webhook_token is set or
github_api_token and github_org are set.
"""
return state.github_webhook_token or all([state.github_api_token, state.github_org])

Expand Down
Loading