Skip to content

Commit

Permalink
w secret
Browse files Browse the repository at this point in the history
  • Loading branch information
jhsuss committed Oct 21, 2024
1 parent 7fe582f commit d2bfd54
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/run-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
run: pipenv install --ignore-pipfile

- name: Run python code
env: # Set the secret as an input
FUTURE_FIRST: ${{ secrets.FUTURE_FIRST }}
# FIRST_NAME: Joel
# LAST_NAME: Suss
run: pipenv run start

- uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
22 changes: 12 additions & 10 deletions src/fetch.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import requests
import os

def get_data():
# res = requests.get("https://dummyjson.com/products?limit=10&select=id,title,brand,price")
# data = res.json().get('products')
# print(f"Loaded {len(data)} rows of JSON from the API")
# return data

# r = requests.get("https://www.goodjudgment.io/futurefirst/api/forecasts", headers = {"Authorization": "Bearer 8030152dfa8a9930ec132f831500dd54c55c1889"})
r = requests.get("https://goodjudgment.io/futurefirst/api/fcsv", headers = {"Authorization": "Bearer 8030152dfa8a9930ec132f831500dd54c55c1889"})

# Retrieve the environment variable "key"
key = os.getenv("FUTURE_FIRST")

#r.json()
#r.json()["status"]
# r = requests.get("https://goodjudgment.io/futurefirst/api/fcsv", headers = {"Authorization": "Bearer 8030152dfa8a9930ec132f831500dd54c55c1889"})

r = requests.get(
"https://goodjudgment.io/futurefirst/api/fcsv",
headers = {"Authorization": "Bearer " + key}
)

data = r.json()["data"]
print(f"Loaded {len(data)} rows of CSV from the API")
return data

#res = r.json()




0 comments on commit d2bfd54

Please sign in to comment.