From 31b759c08be4f9002a5321a541721f0916f3e509 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 22:10:03 +0100 Subject: [PATCH] Fix update-site-data workflow race condition on branch push (#2366) * Initial plan * Fix update-site-data workflow race condition on branch push - Add concurrency control to cancel in-progress runs on new pushes to main - Delete existing PR branch before creating new one to avoid stale ref conflicts - Upgrade peter-evans/create-pull-request from v5 to v7 (Node.js 20 deprecation) Co-authored-by: soxoj <31013580+soxoj@users.noreply.github.com> Agent-Logs-Url: https://github.com/soxoj/maigret/sessions/a095d3d3-0093-43e8-9cc5-82797bd52453 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: soxoj <31013580+soxoj@users.noreply.github.com> --- .github/workflows/update-site-data.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-site-data.yml b/.github/workflows/update-site-data.yml index b4eb406..1b5b2ea 100644 --- a/.github/workflows/update-site-data.yml +++ b/.github/workflows/update-site-data.yml @@ -4,6 +4,10 @@ on: push: branches: [ main ] +concurrency: + group: update-sites-${{ github.ref }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-latest @@ -36,9 +40,13 @@ jobs: echo "has_changes=false" >> $GITHUB_OUTPUT fi + - name: Delete existing PR branch + if: steps.check.outputs.has_changes == 'true' + run: git push origin --delete auto/update-sites-list || true + - name: Create Pull Request if: steps.check.outputs.has_changes == 'true' - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: "Updated site list and statistics"