-
-
Save KyMidd/4e26f72483a9a63ade55db5f21357772 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Function | |
| def initial_var_validation(): | |
| # Get env variable GITHUB_TOKEN, and if not present, exit | |
| if 'GITHUB_TOKEN' not in os.environ: | |
| print("GITHUB_TOKEN not found in environment variables") | |
| exit(1) | |
| # Read repo we should evluate as an environmental var | |
| if 'GITHUB_ORG' not in os.environ: | |
| print("GITHUB_ORG not found in environment variables") | |
| exit(1) | |
| return True | |
| # Calling it | |
| if initial_var_validation() == True: | |
| GITHUB_ORG = os.environ['GITHUB_ORG'] | |
| GITHUB_TOKEN = os.environ['GITHUB_TOKEN'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment