Use newest branch if we have multiple matches.

This commit is contained in:
Michael Lipp 2024-06-24 10:04:09 +02:00
parent e994fa1543
commit 8a434d8410

View file

@ -24,7 +24,7 @@ stages:
- "*/build"
before_script:
- echo -n $CI_REGISTRY_PASSWORD | podman login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
- git switch $(git branch -r --contains $CI_COMMIT_SHA | sed -e 's#[^/]*/##')
- git switch $(git branch -r --sort="authordate" --contains $CI_COMMIT_SHA | head -1 | sed -e 's#[^/]*/##')
- git pull
- git reset --hard $CI_COMMIT_SHA