From 6f298eb27822df1b4225eeec1a9e51251f14802d Mon Sep 17 00:00:00 2001 From: RAprogramm Date: Sun, 19 Oct 2025 14:12:44 +0700 Subject: [PATCH] #43 fix: add git pull before push in metrics workflows - Add git pull --rebase origin main before git push - Prevents race condition when workflows run in parallel - Both benchmark and tokei-metrics can now update README safely Problem: - benchmark.yml and tokei-metrics.yml trigger simultaneously - Both checkout, modify README, commit, and push - Second push fails with 'rejected' error Solution: - Pull and rebase before pushing - Merges changes from parallel workflow - Safe concurrent execution Related: Closes #43 --- .github/workflows/benchmark.yml | 1 + .github/workflows/tokei-metrics.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index ce1b800..a29b210 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -176,5 +176,6 @@ jobs: else git add README.md git commit -m "chore: update benchmark results [skip ci]" + git pull --rebase origin main git push fi diff --git a/.github/workflows/tokei-metrics.yml b/.github/workflows/tokei-metrics.yml index a2b592d..7b3ce50 100644 --- a/.github/workflows/tokei-metrics.yml +++ b/.github/workflows/tokei-metrics.yml @@ -156,5 +156,6 @@ jobs: else git add README.md git commit -m "chore: update tokei metrics [skip ci]" + git pull --rebase origin main git push fi