Skip to content

Commit

Permalink
read from secrets?
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhong5297 committed Nov 28, 2023
1 parent 67ab258 commit 03ef844
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
run: pip install -r requirements.txt

- name: Run test script
env:
DUNE_API_KEY: ${{ secrets.DUNE_API_KEY }}
run: python -u github_workflows/action.py

- name: Print name
Expand Down
18 changes: 17 additions & 1 deletion github_workflows/action.py
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
print('test action hello wrld')
print('test action hello wrld')

import yaml
from dune_client.client import DuneClient

dune = DuneClient.from_env()

# Read the queries.yml file
with open('queries.yml', 'r') as file:
data = yaml.safe_load(file)

# Extract the query_ids from the data
query_ids = [id for id in data['query_ids']]

for id in query_ids:
query = dune.get_query(id)
print(query)
9 changes: 6 additions & 3 deletions queries.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

query_ids:
- query_id_1
- query_id_2
- query_id_3
- 3237721
- 3237738
- 3237745
- 3237723
- 3237726
- 3237742

0 comments on commit 03ef844

Please sign in to comment.