From 1868be27351d7781d106c0911b86f1d2ae5ca4bc Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Sun, 18 Oct 2026 18:19:21 +0200 Subject: [PATCH] Use explicit Gitea revision variables --- .gitea/workflows/container.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/container.yml b/.gitea/workflows/container.yml index 0f1bd7a..86ab8d8 100644 --- a/.gitea/workflows/container.yml +++ b/.gitea/workflows/container.yml @@ -40,14 +40,17 @@ jobs: - name: Build and push image if: gitea.ref == 'refs/heads/main' || startsWith(gitea.ref, 'refs/tags/v') + env: + COMMIT_SHA: ${{ gitea.sha }} + GIT_REF: ${{ gitea.ref }} run: | docker build --load \ - --label "org.opencontainers.image.revision=${GITEA_SHA}" \ + --label "org.opencontainers.image.revision=${COMMIT_SHA}" \ --label "org.opencontainers.image.source=https://code.brunner.ninja/feedc0de/immich-sync" \ - --tag "${IMAGE}:${GITEA_SHA}" . - docker push "${IMAGE}:${GITEA_SHA}" - if [ "${GITEA_REF}" = refs/heads/main ]; then - docker tag "${IMAGE}:${GITEA_SHA}" "${IMAGE}:latest" + --tag "${IMAGE}:${COMMIT_SHA}" . + docker push "${IMAGE}:${COMMIT_SHA}" + if [ "${GIT_REF}" = refs/heads/main ]; then + docker tag "${IMAGE}:${COMMIT_SHA}" "${IMAGE}:latest" docker push "${IMAGE}:latest" fi @@ -55,10 +58,11 @@ jobs: if: gitea.ref == 'refs/heads/main' || startsWith(gitea.ref, 'refs/tags/v') env: CHART_VERSION: ${{ steps.version.outputs.version }} + COMMIT_SHA: ${{ gitea.sha }} run: | mkdir -p dist helm package chart --destination dist \ - --version "${CHART_VERSION}" --app-version "${GITEA_SHA}" + --version "${CHART_VERSION}" --app-version "${COMMIT_SHA}" curl --fail-with-body --user "${{ secrets.PACKAGE_USERNAME }}:${{ secrets.PACKAGE_TOKEN }}" \ --request POST \ --upload-file "dist/immich-sync-${CHART_VERSION}.tgz" \ @@ -66,9 +70,11 @@ jobs: - name: Check that this is still current main if: gitea.ref == 'refs/heads/main' + env: + COMMIT_SHA: ${{ gitea.sha }} run: | git fetch --no-tags origin main - test "$(git rev-parse FETCH_HEAD)" = "${GITEA_SHA}" + test "$(git rev-parse FETCH_HEAD)" = "${COMMIT_SHA}" - name: Check out GitOps repository if: gitea.ref == 'refs/heads/main'