fix(ci): synchronize release branches from a clean worktree (#7036)
This commit is contained in:
1 parent
e089d690ee
commit
6ce517df92
1 file changed
+10
-6
@@ -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
|
||||
|
||||
Reference in new issue
Block a user