Skip to content

Commit

Permalink
fix handling of token
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro committed Dec 11, 2024
1 parent 480b811 commit b32847b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion download_constraints.py
Original file line number Diff line number Diff line change
@@ -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 <GitLab token>")
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
Expand Down

0 comments on commit b32847b

Please sign in to comment.