mirror of
https://github.com/vacp2p/dst-prefect-workflows.git
synced 2026-01-09 13:28:12 -05:00
GitHub token is now an env var, other fixes
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -0,0 +1,2 @@
|
||||
prefect/10ksim/**
|
||||
**/.env
|
||||
|
||||
6
prefect/README.md
Normal file
6
prefect/README.md
Normal 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
3
prefect/requirements.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
requests
|
||||
dotenv
|
||||
prefect
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user