diff --git a/.github/workflows/build-site.yml b/.github/workflows/build-site.yml index f11eaee..e5dabd6 100644 --- a/.github/workflows/build-site.yml +++ b/.github/workflows/build-site.yml @@ -34,7 +34,7 @@ jobs: run: poetry install - name: download constraints.json from gitlab - run: poetry run python download_constraints.py + run: poetry run python download_constraints.py ${{ secrets.GITLAB_TOKEN }} - name: make index.html run: poetry run python make_site.py diff --git a/download_constraints.py b/download_constraints.py index 377aafb..f5084e4 100644 --- a/download_constraints.py +++ b/download_constraints.py @@ -1,13 +1,18 @@ import requests import zipfile +import sys import io import json import os +if len(sys.argv) != 2: + print("Usage: python download_constraints.py ") + sys.exit(1) + # Define the URL and headers url = "https://bas-im.emcs.cornell.edu/api/v4/projects/3/jobs/artifacts/master/download?job=document" headers = { - "PRIVATE-TOKEN": os.environ.get('GITLAB_TOKEN'), + "PRIVATE-TOKEN": sys.argv[1] # Pass the GitLab token as a command-line argument } # Download the ZIP file