File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ name : analytics
2+ # Triggers the workflow every 5 minutes
3+ on :
4+ push
5+ # schedule:
6+ # - cron: "* * * * *"
7+ jobs :
8+ cron :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v3
12+ - uses : actions/setup-python@v4
13+ with :
14+ python-version : ' 3.10'
15+ - run : python -m pip install -r analytics/requirements.txt
16+ - env :
17+ GH_SECRET : ${{ secrets.GITHUB_TOKEN }}
18+ run : python .github/workflows/analytics/cron.py
Original file line number Diff line number Diff line change 1+ import os
2+
3+ import requests
4+
5+ GH_SECRET = os .environ .get ('GH_SECRET' )
6+ GH_TRAFFIC_VIEWS_URL = "https://api.github.com/repos/explodinggradients/ragas/traffic/views"
7+
8+ repo_response = requests .get (GH_TRAFFIC_VIEWS_URL ,headers = {
9+ 'Accept' : 'application/vnd.github.v3+json' ,
10+ 'Authorization' : f"Bearer { GH_SECRET } "
11+ })
12+ print (repo_response .json ())
You can’t perform that action at this time.
0 commit comments