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

Only check spnosor_info for boolean if it exists. #54

Merged
merged 1 commit into from
Nov 30, 2023
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
1 change: 0 additions & 1 deletion .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ ORGANIZATION = "organization"
START_DATE = ""
END_DATE = ""
GH_ENTERPRISE_URL=" "
SPONSOR_INFO = "False"
15 changes: 9 additions & 6 deletions env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
"""A GitHub Action that given an organization or repository, produces information about the contributors over the specified time period."""
"""
A GitHub Action that given an organization or repository,
produces information about the contributors over the specified time period.
"""

import os
from os.path import dirname, join
Expand Down Expand Up @@ -35,7 +38,7 @@ def get_env_vars() -> (
# Either organization or repository must be set
if not organization and not repositories_str:
raise ValueError(
"ORGANIZATION and REPOSITORY environment variables were both not set. Please enter a valid value for one of them."
"ORGANIZATION and REPOSITORY environment variables were not set. Please set one"
)

token = os.getenv("GH_TOKEN")
Expand All @@ -59,10 +62,10 @@ def get_env_vars() -> (
# make sure that sponsor_string is a boolean
if sponsor_info:
sponsor_info = sponsor_info.lower().strip()
if sponsor_info not in ["true", "false", ""]:
raise ValueError(
"SPONSOR_INFO environment variable not a boolean. ie. True or False or blank"
)
if sponsor_info not in ["true", "false", ""]:
raise ValueError(
"SPONSOR_INFO environment variable not a boolean. ie. True or False or blank"
)

# Separate repositories_str into a list based on the comma separator
repositories_list = []
Expand Down