diff --git a/.github/workflows/deployment-docker-image.yml b/.github/workflows/deployment-docker-image.yml index eb56567d9..ddb986414 100644 --- a/.github/workflows/deployment-docker-image.yml +++ b/.github/workflows/deployment-docker-image.yml @@ -123,15 +123,19 @@ jobs: env: GITHUB_TOKEN: ${{ steps.obtainToken.outputs.token }} UPSTREAM_BRANCH: ${{ github.ref_name == 'main' && 'dev' || 'next' }} + RELEASE_REF: ${{ steps.read-git-ref.outputs.ref }} run: | git config user.name "Releases Homarr" git config user.email "175486441+homarr-releases[bot]@users.noreply.github.com" - git remote set-url origin https://x-access-token:${{ steps.obtainToken.outputs.token }}@github.com/${{ github.repository }}.git - git fetch origin ${{ env.UPSTREAM_BRANCH }} - git checkout ${{ env.UPSTREAM_BRANCH }} - git pull origin ${{ env.UPSTREAM_BRANCH }} - git rebase ${{ github.ref_name }} - git push origin ${{ env.UPSTREAM_BRANCH }} + git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" + git fetch origin "$UPSTREAM_BRANCH" + + # Dependency installation can modify generated files in the release checkout. + sync_dir="$(mktemp -d "${RUNNER_TEMP}/homarr-release-sync.XXXXXX")" + trap 'git worktree remove --force "$sync_dir"' EXIT + git worktree add --detach "$sync_dir" FETCH_HEAD + git -C "$sync_dir" merge --no-edit "$RELEASE_REF" + git -C "$sync_dir" push origin "HEAD:${UPSTREAM_BRANCH}" build-amd64: name: Build docker image for amd64 needs: release