Skip to content

Commit

Permalink
add data sort workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoKle committed Oct 14, 2024
1 parent 5b82006 commit 6103384
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/data-sorting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: data sorter
run-name: Sorting data on branch ${{github.ref_name}}
on:
push:
branches:
- "!main"
- "!production"
- "*"

permissions: write-all
jobs:
sort-data:
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v2

- name: setup python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: sort data
run: python src/sort_data.py

- name: commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git diff-index --quiet HEAD || (git commit -a -m "Sorted and formatted data" --allow-empty)
- name: push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pydantic==2.9.2
toml==0.10.2
4 changes: 4 additions & 0 deletions src/sort_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from classes.datahub import Datahub


Datahub().sort_data()

0 comments on commit 6103384

Please sign in to comment.