From 593ae09fa9a743512d5611e8d9c04a04f74cb77b Mon Sep 17 00:00:00 2001 From: Elio Bischof Date: Mon, 13 Oct 2025 09:08:47 +0200 Subject: [PATCH] chore: fix lint test build on main (#10866) # Which Problems Are Solved In order for golangci-lint to be able to compare what changed against main, we have to check out main on branches. If the pipeline runs on main, the branch can't be checked out twice and the pipeline fails. # How the Problems Are Solved The step `Fetch main branch` in `lint_test_build` is only executed if the workflow doesn't run on main, because in this case, the branch is already checked out by the `Checkout Repository` step. # Additional Changes PRs can only be merged if `lint_test_buld` succeeds on an up-to-date branch. When a PR is merged, it triggers a push event which runs `lint_test_build` again on main with the same conditions. This is obsolete. Pushes to main don't trigger the `lint_test_build` workflow anymore. # Additional Context - Resolves https://github.com/zitadel/zitadel/actions/runs/18339015014/job/52229685065 --- .github/workflows/ci.yml | 1 + .github/workflows/lint_test_build.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58b5f65b0..4fbe91db2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,7 @@ permissions: jobs: lint_test_build: uses: ./.github/workflows/lint_test_build.yml + if: ${{ github.ref != 'refs/heads/main' || github.event_name == 'workflow_dispatch' }} permissions: contents: read with: diff --git a/.github/workflows/lint_test_build.yml b/.github/workflows/lint_test_build.yml index 66b21aacc..0e7567d51 100644 --- a/.github/workflows/lint_test_build.yml +++ b/.github/workflows/lint_test_build.yml @@ -24,6 +24,7 @@ jobs: fetch-depth: 0 filter: tree:0 - name: Fetch main branch + if: ${{ github.ref != 'refs/heads/main' }} run: git fetch origin main:main - name: Set up Go uses: actions/setup-go@v5