-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (35 loc) · 1.24 KB
/
monthly_data_fetch.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
40
41
42
43
44
name: Monthly Data Fetch
on:
schedule:
- cron: '0 0 1 * *' # Runs at 00:00 on the first day of every month
workflow_dispatch: # Allows for manual triggering of the workflow
jobs:
fetch-and-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Poetry
run: |
pip install poetry
- name: Install dependencies
run: poetry install
- name: Run data fetcher script
run: poetry run python iata_code_fetcher/fetcher.py
- name: Sort and remove duplicates
run: |
cat carrier_data_full.jsonl | sort | uniq > carrier_data_full_unique.jsonl
cat airport_data_full.jsonl | sort | uniq > airport_data_full_unique.jsonl
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add carrier_data_full_unique.jsonl airport_data_full_unique.jsonl
git commit -m 'Update unique data files [skip ci]'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}