1 Commits

Author SHA1 Message Date
5b10145276 infra: actions: fix docker changes detector so it doesnt always build on force pushes
Some checks failed
Gentoo Utils / build (push) Has been cancelled
Gentoo Utils / test (push) Has been cancelled
Gentoo Utils / check-format (push) Has been cancelled
Gentoo Utils / docs (push) Has been cancelled
Gentoo Utils / build-oci-image (push) Has been cancelled
2025-12-12 18:22:17 -06:00

View File

@@ -16,13 +16,13 @@ jobs:
id: image-changes
# build image only if 1. changes are detected or 2. an image for the working branch doesnt exist
run: |
git --no-pager log --oneline
echo "BEFORE = ${{ gitea.event.before }}"
branch_name="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
default_branch_name="${{ gitea.event.repository.default_branch }}"
image_tag=latest
comparison_hash="${{ gitea.event.before }}"
git --no-pager reflog -n $(git rev-list --count HEAD ^origin/$default_branch_name)
if [[ "$branch_name" != "${{ gitea.event.repository.default_branch }}" ]]; then
image_tag=$branch_name
fi