Skip to content

Commit cef31b3

Browse files
authored
adding gh actions to sort-lessons.yml
1 parent 3ff900f commit cef31b3

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/sort-lessons.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Sort Lessons YAML
2+
3+
on:
4+
push:
5+
paths:
6+
- '_data/ui-text.yml'
7+
- '.github/scripts/sort_lessons.py'
8+
workflow_dispatch:
9+
10+
jobs:
11+
sort-lessons:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.x'
21+
22+
- name: Install dependencies
23+
run: pip install pyyaml
24+
25+
- name: Run sorting script
26+
run: python .github/scripts/sort_lessons.py
27+
28+
- name: Commit and push changes
29+
run: |
30+
git config --global user.name "github-actions"
31+
git config --global user.email "actions@github.com"
32+
git add _data/ui-text-sorted.yml
33+
git diff --cached --quiet || git commit -m "Auto-sorted lessons YAML"
34+
git push

0 commit comments

Comments
 (0)