Skip to content

Commit 8045684

Browse files
committed
Merge remote-tracking branch 'origin/main'
1 parent f9b801b commit 8045684

File tree

7 files changed

+433
-102
lines changed

7 files changed

+433
-102
lines changed

.github/workflows/run-program.yml

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,34 @@
1-
name: Skripte ausführen und README aktualisieren
1+
name: 🗓️ Update Python Day Counter
22

33
on:
44
push:
55
branches: [main]
6+
schedule:
7+
- cron: "0 8 * * *"
68
workflow_dispatch:
79

810
jobs:
9-
run-scripts:
11+
update-day-counter:
1012
runs-on: ubuntu-latest
1113

1214
steps:
13-
- name: Checkout repository
15+
- name: 📥 Checkout repository
1416
uses: actions/checkout@v3
1517

16-
- name: Setup Python
18+
- name: 🐍 Set up Python
1719
uses: actions/setup-python@v4
1820
with:
1921
python-version: '3.12'
2022

21-
- name: Run Herztext.py
22-
working-directory: ./simple_py_program
23-
run: python Herztext.py
24-
25-
- name: Run Sanduhr.py
26-
working-directory: ./simple_py_program
27-
run: python Sanduhr.py
28-
29-
- name: Run day_counter.py
23+
- name: ▶️ Run day_counter.py
3024
working-directory: ./simple_py_program
3125
run: python day_counter.py
3226

33-
- name: Insert Outputs into README
34-
run: |
35-
declare -A outputs
36-
outputs[HERZTEXT]="output_Herztext.md"
37-
outputs[SANDUHR]="output_Sanduhr.md"
38-
39-
# Insert outputs into README file
40-
for key in "${!outputs[@]}"; do
41-
start="<!-- ${key}_OUTPUT_START -->"
42-
end="<!-- ${key}_OUTPUT_END -->"
43-
content=$(cat "${outputs[$key]}")
44-
awk -v s="$start" -v e="$end" -v r="$content" '
45-
BEGIN {print_section=1}
46-
$0 ~ s {print; print r; print_section=0; next}
47-
$0 ~ e {print_section=1}
48-
print_section==1 {print}
49-
' README.md > tmp && mv tmp README.md
50-
done
51-
52-
- name: Commit changes and push
27+
- name: 📤 Commit and push if changed
5328
run: |
5429
git config --global user.name "1501henify"
5530
git config --global user.email "[email protected]"
56-
git add README.md
57-
git commit -m "README updated with latest outputs and day counter"
31+
git add ../README.md
32+
git diff --cached --quiet || git commit -m "🔁 Updated day counter in README"
5833
git push
5934
continue-on-error: true

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,6 @@ Each one is a small step toward becoming a full-stack developer.
88

99
---
1010

11-
## 🧠 Simple Python Scripts + Output
12-
13-
### 🔸 [`Herztext.py`](https://github.com/1501henify/Learning-Python/blob/main/simple_py_program%2FHerztext.py)
14-
15-
<!-- HERZTEXT_OUTPUT_START -->
16-
<!-- HERZTEXT_OUTPUT_END -->
17-
### 🔸 [`Sanduhr.py`](https://github.com/1501henify/Learning-Python/blob/main/simple_py_program%2FSanduhr.py)
18-
19-
<!-- SANDUHR_OUTPUT_START -->
20-
<!-- SANDUHR_OUTPUT_END -->
21-
2211
## 📆 Day Counter
2312

2413
<!-- PYTHON_DAY_COUNTER -->

0 commit comments

Comments
 (0)