mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-29 21:46:05 +00:00
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
(cherry picked from commit 593ae09fa9)
This commit is contained in:
committed by
Livio Spring
parent
66ed1da33f
commit
42979053da
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@@ -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:
|
||||
|
||||
1
.github/workflows/lint_test_build.yml
vendored
1
.github/workflows/lint_test_build.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user