Skip to content

Commit

Permalink
Merge pull request #54 from github/sponsor_info
Browse files Browse the repository at this point in the history
Only check spnosor_info for boolean if it exists.
  • Loading branch information
zkoppert authored Nov 30, 2023
2 parents 6399759 + 670527e commit 4e02ca4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
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

0 comments on commit 4e02ca4

Please sign in to comment.