From 1611e04fd9057f2a2d0cacfffb0ebcc096f8214f Mon Sep 17 00:00:00 2001 From: Vincent Koc <25068+vincentkoc@users.noreply.github.com> Date: Wed, 1 Jul 2026 05:50:41 -0700 Subject: [PATCH] fix(ci): keep locale refresh matrices alive --- .github/workflows/control-ui-locale-refresh.yml | 2 +- .github/workflows/native-app-locale-refresh.yml | 2 +- test/scripts/ci-workflow-guards.test.ts | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/control-ui-locale-refresh.yml b/.github/workflows/control-ui-locale-refresh.yml index 412a0adcd4d8..e8fdb4bf7dad 100644 --- a/.github/workflows/control-ui-locale-refresh.yml +++ b/.github/workflows/control-ui-locale-refresh.yml @@ -24,7 +24,7 @@ permissions: concurrency: group: control-ui-locale-refresh-${{ github.event_name == 'push' && github.ref || github.event_name == 'workflow_dispatch' && format('manual-{0}', github.run_id) || github.event_name == 'release' && format('release-{0}', github.event.release.tag_name) || format('{0}-{1}', github.event_name, github.run_id) }} - cancel-in-progress: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + cancel-in-progress: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.actor != 'github-actions[bot]' }} jobs: plan: diff --git a/.github/workflows/native-app-locale-refresh.yml b/.github/workflows/native-app-locale-refresh.yml index 7ea1869ac72f..5c1aed67c6a8 100644 --- a/.github/workflows/native-app-locale-refresh.yml +++ b/.github/workflows/native-app-locale-refresh.yml @@ -22,7 +22,7 @@ permissions: concurrency: group: native-app-locale-refresh-${{ github.event_name == 'push' && github.ref || format('manual-{0}', github.run_id) }} - cancel-in-progress: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + cancel-in-progress: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.actor != 'github-actions[bot]' }} jobs: refresh: diff --git a/test/scripts/ci-workflow-guards.test.ts b/test/scripts/ci-workflow-guards.test.ts index c1de4ddbe268..63926874c173 100644 --- a/test/scripts/ci-workflow-guards.test.ts +++ b/test/scripts/ci-workflow-guards.test.ts @@ -9,6 +9,7 @@ const CACHE_V5 = "actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae const UPLOAD_ARTIFACT_V7 = "actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a"; const OPENGREP_PR_DIFF_WORKFLOW = ".github/workflows/opengrep-precise.yml"; const OPENGREP_FULL_WORKFLOW = ".github/workflows/opengrep-precise-full.yml"; +const CONTROL_UI_LOCALE_REFRESH_WORKFLOW = ".github/workflows/control-ui-locale-refresh.yml"; const NATIVE_APP_LOCALE_REFRESH_WORKFLOW = ".github/workflows/native-app-locale-refresh.yml"; function readCiWorkflow() { @@ -119,7 +120,8 @@ describe("ci workflow guards", () => { expect(findUnpinnedExternalActions()).toEqual([]); }); - it("keeps native locale refreshes main-only and rebases before retrying pushes", () => { + it("keeps locale refresh bots from cancelling active refresh matrices", () => { + const controlUiWorkflow = parse(readFileSync(CONTROL_UI_LOCALE_REFRESH_WORKFLOW, "utf8")); const source = readFileSync(NATIVE_APP_LOCALE_REFRESH_WORKFLOW, "utf8"); const workflow = parse(source); const refresh = workflow.jobs.refresh; @@ -129,6 +131,12 @@ describe("ci workflow guards", () => { expect(refresh.if).toContain("github.ref == 'refs/heads/main'"); expect(refresh.strategy.matrix.locale).toContain("sv"); + expect(controlUiWorkflow.concurrency["cancel-in-progress"]).toContain( + "github.actor != 'github-actions[bot]'", + ); + expect(workflow.concurrency["cancel-in-progress"]).toContain( + "github.actor != 'github-actions[bot]'", + ); expect(workflow.on.push.paths).toContain("ui/src/i18n/.i18n/glossary.*.json"); expect(commitStep.run).toContain("for attempt in 1 2 3 4 5"); expect(commitStep.run).toContain('git fetch origin "${TARGET_BRANCH}"');