GitHub token is now an env var, other fixes

This commit is contained in:
Benjamin Arntzen
2025-03-26 17:43:11 +00:00
parent a467e58b8e
commit aff05cd4e1
4 changed files with 20 additions and 1 deletions

2
.gitignore vendored
View File

@@ -0,0 +1,2 @@
prefect/10ksim/**
**/.env

6
prefect/README.md Normal file
View File

@@ -0,0 +1,6 @@
# How to use
* Install required packages
`pip3 install -U prefect --break-system-packages`
* Inject your key into .env as GITHUB_TOKEN=ghp...
* Create a GitHub issue with details about your simulation
* Run `run.py` and collect your results.

3
prefect/requirements.txt Normal file
View File

@@ -0,0 +1,3 @@
requests
dotenv
prefect

View File

@@ -5,6 +5,10 @@ import base64
import requests
import json
import os
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
AUTHORIZED_USERS = ["zorlin", "AlbertoSoutullo", "michatinkers"]
@@ -507,4 +511,8 @@ def deployment_cron_job(repo_name: str, github_token: str):
# Local debug run
if __name__ == "__main__":
deployment_cron_job(repo_name="vacp2p/vaclab", github_token="")
github_token = os.getenv("GITHUB_TOKEN")
if not github_token:
print("Error: GITHUB_TOKEN environment variable not set. Please create a .env file with your GitHub token.")
exit(1)
deployment_cron_job(repo_name="vacp2p/vaclab", github_token=github_token)