|
11 | 11 | permissions: |
12 | 12 | contents: write |
13 | 13 |
|
| 14 | +# ✅ KEY FIX: Only one run at a time — new runs wait, not cancel |
| 15 | +concurrency: |
| 16 | + group: update-dsa-progress |
| 17 | + cancel-in-progress: false |
| 18 | + |
14 | 19 | jobs: |
15 | 20 | update-readmes: |
16 | 21 | runs-on: ubuntu-latest |
@@ -38,40 +43,19 @@ jobs: |
38 | 43 | - name: Update java_progress README |
39 | 44 | run: python .github/update_readme.py |
40 | 45 |
|
41 | | - # ── 4. Commit + push java_progress README (with retry) ─ |
| 46 | + # ── 4. Commit + push java_progress README ────────────── |
42 | 47 | - name: Commit java_progress README |
43 | 48 | run: | |
44 | 49 | git config user.name "github-actions[bot]" |
45 | 50 | git config user.email "github-actions[bot]@users.noreply.github.com" |
46 | 51 | git pull --rebase origin main |
47 | 52 | git add README.md |
48 | | -
|
49 | 53 | if git diff --staged --quiet; then |
50 | 54 | echo "No changes to commit, skipping." |
51 | 55 | exit 0 |
52 | 56 | fi |
53 | | -
|
54 | 57 | git commit -m "📊 Auto-update DSA progress table" |
55 | | -
|
56 | | - set +e # ← disable exit-on-error so the loop can retry |
57 | | - PUSHED=false |
58 | | - for i in 1 2 3 4 5; do |
59 | | - echo "Push attempt $i of 5..." |
60 | | - git pull --rebase origin main |
61 | | - if git push; then |
62 | | - echo "✅ Push succeeded on attempt $i!" |
63 | | - PUSHED=true |
64 | | - break |
65 | | - fi |
66 | | - echo "❌ Push failed, waiting 5s before retry..." |
67 | | - sleep 5 |
68 | | - done |
69 | | - set -e # ← re-enable exit-on-error |
70 | | -
|
71 | | - if [ "$PUSHED" = false ]; then |
72 | | - echo "💀 All push attempts failed." |
73 | | - exit 1 |
74 | | - fi |
| 58 | + git push |
75 | 59 |
|
76 | 60 | # ── 5. Checkout profile repo (rajit2004/rajit2004) ───── |
77 | 61 | - name: Checkout profile repo |
@@ -105,38 +89,17 @@ jobs: |
105 | 89 | print("[+] Profile README updated.") |
106 | 90 | EOF |
107 | 91 |
|
108 | | - # ── 7. Commit + push profile README (with retry) ─────── |
| 92 | + # ── 7. Commit + push profile README ─────────────────── |
109 | 93 | - name: Commit profile README |
110 | 94 | working-directory: profile-repo |
111 | 95 | run: | |
112 | 96 | git config user.name "github-actions[bot]" |
113 | 97 | git config user.email "github-actions[bot]@users.noreply.github.com" |
114 | 98 | git pull --rebase origin main |
115 | 99 | git add README.md |
116 | | -
|
117 | 100 | if git diff --staged --quiet; then |
118 | 101 | echo "No changes to commit, skipping." |
119 | 102 | exit 0 |
120 | 103 | fi |
121 | | -
|
122 | 104 | git commit -m "📊 Auto-update DSA progress table from java_progress" |
123 | | -
|
124 | | - set +e |
125 | | - PUSHED=false |
126 | | - for i in 1 2 3 4 5; do |
127 | | - echo "Push attempt $i of 5..." |
128 | | - git pull --rebase origin main |
129 | | - if git push; then |
130 | | - echo "✅ Push succeeded on attempt $i!" |
131 | | - PUSHED=true |
132 | | - break |
133 | | - fi |
134 | | - echo "❌ Push failed, waiting 5s before retry..." |
135 | | - sleep 5 |
136 | | - done |
137 | | - set -e |
138 | | -
|
139 | | - if [ "$PUSHED" = false ]; then |
140 | | - echo "💀 All push attempts failed." |
141 | | - exit 1 |
142 | | - fi |
| 105 | + git push |
0 commit comments