Skip to content

Commit d1913ca

Browse files
authored
Merge pull request #11 from MishkatIT/copilot/fix-git-action-updates
Fix GitHub Actions auto-update: workflow configuration and update source tracking
2 parents d877007 + c1ca097 commit d1913ca

4 files changed

Lines changed: 20 additions & 31 deletions

File tree

‎.github/workflows/update-stats.yml‎

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,16 @@ jobs:
2121
with:
2222
python-version: '3.12'
2323

24-
- name: Fetch latest statistics
24+
- name: Fetch latest statistics and update README
2525
id: fetch_stats
2626
run: |
27-
python3 update_stats.py > stats_output.txt 2>&1 || true
28-
cat stats_output.txt
29-
30-
# Extract JSON output
31-
sed -n '/JSON Output:/,${p;/^}$/q}' stats_output.txt | tail -n +2 > stats.json
32-
cat stats.json
33-
34-
- name: Update README if stats were fetched
35-
run: |
36-
if [ -f stats.json ]; then
37-
echo "Statistics file found, updating README..."
38-
python3 update_readme.py
39-
else
40-
echo "No statistics file found, skipping README update"
41-
fi
27+
python3 update_stats.py 2>&1 | tee stats_output.txt
4228
4329
- name: Commit and push if changed
4430
run: |
4531
git config --global user.name 'GitHub Action'
4632
git config --global user.email 'action@github.com'
47-
git add README.md last_known_counts.json
33+
git add README.md
4834
if git diff --staged --quiet; then
4935
echo "No changes to commit"
5036
else

‎README.md‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
# 🏆 Problem Solving Statistics
44

5-
[![Last Updated](https://img.shields.io/badge/Last%20Updated-15%20January%202026-blue?style=for-the-badge)](https://github.com/MishkatIT/ProblemSolvingStats)
5+
[![Last Updated](https://img.shields.io/badge/Last%20Updated-14%20January%202026-blue?style=for-the-badge)](https://github.com/MishkatIT/ProblemSolvingStats)
66
[![Total Problems](https://img.shields.io/badge/Total%20Solved-3526-success?style=for-the-badge&logo=leetcode)](https://github.com/MishkatIT/ProblemSolvingStats)
77
[![Platforms](https://img.shields.io/badge/Platforms-12-orange?style=for-the-badge)](https://github.com/MishkatIT/ProblemSolvingStats)
88

99
<!-- UPDATE_METADATA_START -->
10-
<p align="center"><strong>Updated:</strong> 15 January 2026 • <strong>Mode:</strong> Unknown</p>
10+
<p align="center"><strong>Updated:</strong> 14 January 2026 • <strong>Mode:</strong> Automatic</p>
1111
<!-- UPDATE_METADATA_END -->
1212

1313
### 💻 Competitive Programming Journey
@@ -35,13 +35,13 @@
3535
<tr>
3636
<td><strong>🔴 Codeforces</strong></td>
3737
<td><a href="https://codeforces.com/profile/MishkatIT">MishkatIT</a></td>
38-
<td align="center"><strong>2386 <br/><small>(last updated: 15 January 2026)</small></strong></td>
38+
<td align="center"><strong>2386</strong></td>
3939
<td><img src="https://img.shields.io/badge/Progress-67.7%25-red?style=flat-square" alt="Codeforces Progress"/></td>
4040
</tr>
4141
<tr>
4242
<td><strong>🟢 LeetCode</strong></td>
4343
<td><a href="https://leetcode.com/MishkatIT/">MishkatIT</a></td>
44-
<td align="center"><strong>412 <br/><small>(last updated: 15 January 2026)</small></strong></td>
44+
<td align="center"><strong>412</strong></td>
4545
<td><img src="https://img.shields.io/badge/Progress-11.7%25-yellow?style=flat-square" alt="LeetCode Progress"/></td>
4646
</tr>
4747
<tr>
@@ -53,55 +53,55 @@
5353
<tr>
5454
<td><strong>🟠 AtCoder</strong></td>
5555
<td><a href="https://atcoder.jp/users/MishkatIT">MishkatIT</a></td>
56-
<td align="center"><strong>158 <br/><small>(last updated: unknown)</small></strong></td>
56+
<td align="center"><strong>158</strong></td>
5757
<td><img src="https://img.shields.io/badge/Progress-4.5%25-orange?style=flat-square" alt="AtCoder Progress"/></td>
5858
</tr>
5959
<tr>
6060
<td><strong>🟤 CodeChef</strong></td>
6161
<td><a href="https://www.codechef.com/users/MishkatIT">MishkatIT</a></td>
62-
<td align="center"><strong>3 <br/><small>(last updated: 15 January 2026)</small></strong></td>
62+
<td align="center"><strong>3</strong></td>
6363
<td><img src="https://img.shields.io/badge/Progress-0.1%25-brown?style=flat-square" alt="CodeChef Progress"/></td>
6464
</tr>
6565
<tr>
6666
<td><strong>⚪ CSES</strong></td>
6767
<td><a href="https://cses.fi/user/165802/">MishkatIT</a></td>
68-
<td align="center"><strong>64 <br/><small>(last updated: unknown)</small></strong></td>
68+
<td align="center"><strong>64</strong></td>
6969
<td><img src="https://img.shields.io/badge/Progress-1.8%25-lightgray?style=flat-square" alt="CSES Progress"/></td>
7070
</tr>
7171
<tr>
7272
<td><strong>🔵 Toph</strong></td>
7373
<td><a href="https://toph.co/u/MishkatIT">MishkatIT</a></td>
74-
<td align="center"><strong>35 <br/><small>(last updated: unknown)</small></strong></td>
74+
<td align="center"><strong>35</strong></td>
7575
<td><img src="https://img.shields.io/badge/Progress-1.0%25-blue?style=flat-square" alt="Toph Progress"/></td>
7676
</tr>
7777
<tr>
7878
<td><strong>🟡 LightOJ</strong></td>
7979
<td><a href="https://lightoj.com/user/mishkatit">MishkatIT</a></td>
80-
<td align="center"><strong>31 <br/><small>(last updated: 15 January 2026)</small></strong></td>
80+
<td align="center"><strong>31</strong></td>
8181
<td><img src="https://img.shields.io/badge/Progress-0.9%25-yellow?style=flat-square" alt="LightOJ Progress"/></td>
8282
</tr>
8383
<tr>
8484
<td><strong>🟩 SPOJ</strong></td>
8585
<td><a href="https://www.spoj.com/users/mishkatit/">MishkatIT</a></td>
86-
<td align="center"><strong>21 <br/><small>(last updated: unknown)</small></strong></td>
86+
<td align="center"><strong>21</strong></td>
8787
<td><img src="https://img.shields.io/badge/Progress-0.6%25-green?style=flat-square" alt="SPOJ Progress"/></td>
8888
</tr>
8989
<tr>
9090
<td><strong>💚 HackerRank</strong></td>
9191
<td><a href="https://www.hackerrank.com/MishkatIT">MishkatIT</a></td>
92-
<td align="center"><strong>7 <br/><small>(last updated: unknown)</small></strong></td>
92+
<td align="center"><strong>7</strong></td>
9393
<td><img src="https://img.shields.io/badge/Progress-0.2%25-brightgreen?style=flat-square" alt="HackerRank Progress"/></td>
9494
</tr>
9595
<tr>
9696
<td><strong>🔷 UVa</strong></td>
9797
<td><a href="https://uhunt.onlinejudge.org/id/1615470">MishkatIT</a></td>
98-
<td align="center"><strong>6 <br/><small>(last updated: 15 January 2026)</small></strong></td>
98+
<td align="center"><strong>6</strong></td>
9999
<td><img src="https://img.shields.io/badge/Progress-0.2%25-blue?style=flat-square" alt="UVa Progress"/></td>
100100
</tr>
101101
<tr>
102102
<td><strong>🌐 HackerEarth</strong></td>
103103
<td><a href="https://www.hackerearth.com/@MishkatIT">MishkatIT</a></td>
104-
<td align="center"><strong>3 <br/><small>(last updated: unknown)</small></strong></td>
104+
<td align="center"><strong>3</strong></td>
105105
<td><img src="https://img.shields.io/badge/Progress-0.1%25-blue?style=flat-square" alt="HackerEarth Progress"/></td>
106106
</tr>
107107
</tbody>

‎manual_update.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ def main():
120120
update = input("\nUpdate README.md with these statistics? (y/n): ").strip().lower()
121121
if update == 'y':
122122
import update_readme
123-
success = update_readme.update_readme(stats, update_source='manual')
123+
# Load last_known_info for proper date tracking
124+
last_known_info = update_readme.load_last_known_info()
125+
success = update_readme.update_readme(stats, last_known_info=last_known_info, update_source='manual')
124126
if success:
125127
print("\n✓ README.md has been updated successfully!")
126128
print(f" Last updated: {datetime.now().strftime('%d %B %Y')}")

‎update_stats.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ def main():
582582
# Update README after fetching (useful for scheduled automation)
583583
try:
584584
import update_readme
585+
# Pass update_source as 'automatic' for auto-updates
585586
update_readme.update_readme(stats, last_known_info=fetcher.last_known_counts, update_source='automatic')
586587
except Exception as e:
587588
print(f"Warning: README update skipped/failed: {e}")

0 commit comments

Comments
 (0)