mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
fix(ci): only create local main branch if non-existent (#164)
## Why this should be merged The CI job in #145 requires a local (to the runner) `main` branch and since `actions/checkout` doesn't check it out, the workflow creates the branch off `origin/main`. However, after merge of a PR to `main`, the workflow is run on `main` itself and that step [fails because the branch already exists](https://github.com/ava-labs/libevm/actions/runs/13908218530/job/38916101218). ## How this works Only call `git branch main origin/main` if `main` doesn't exist. ## How this was tested We'll see once it's merged 🤷
This commit is contained in:
parent
0ed61356ed
commit
7b8d20f3d5
1 changed files with 2 additions and 1 deletions
3
.github/workflows/go.yml
vendored
3
.github/workflows/go.yml
vendored
|
|
@ -53,7 +53,8 @@ jobs:
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: "./libevm/tooling/go.mod"
|
go-version-file: "./libevm/tooling/go.mod"
|
||||||
- run: git branch main origin/main
|
- name: Create local `main` if non-existent
|
||||||
|
run: git show-ref --quiet --verify refs/heads/main || git branch main origin/main
|
||||||
- run: go test -v ./... --target_branch="${{ env.TARGET_BRANCH }}"
|
- run: go test -v ./... --target_branch="${{ env.TARGET_BRANCH }}"
|
||||||
|
|
||||||
go_generate:
|
go_generate:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue