generated from ni/github-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (33 loc) · 1.16 KB
/
store_org_data.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Fetch and Store GitHub Data for Organization
on:
schedule:
- cron: "0 0 * * *" # Run daily at midnight UTC
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
fetch-and-store:
runs-on: self-hosted
steps:
# 1. Checkout the repository
- name: Checkout Code
uses: actions/checkout@v3
# 2. Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
# 3. Install dependencies
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install requests mysql-connector-python
# 4. Run the Python script to fetch and store data
- name: Fetch and Store Data in MySQL
env:
GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }} # Use the PAT instead of the default GITHUB_TOKEN
ORG_NAME: ni
REQUIRED_TOPIC: ni-open-source
MYSQL_HOST: 127.0.0.1
MYSQL_USER: root
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
MYSQL_DATABASE: ni_open_source_github_data
run: python .github/scripts/fetch_store_org_data_conditional.py