diff --git a/.github/repos-config.json b/.github/repos-config.json index 90618703fb0..836ad59fdd2 100644 --- a/.github/repos-config.json +++ b/.github/repos-config.json @@ -131,8 +131,8 @@ "url": "ROCm/rocPRIM", "branch": "develop", "category": "projects", - "auto_subtree_pull": true, - "auto_subtree_push": false, + "auto_subtree_pull": false, + "auto_subtree_push": true, "enable_pr_fanout": false }, { diff --git a/.github/workflows/update-subtrees.yml b/.github/workflows/update-subtrees.yml index ccdcec1f2a5..67be1ca315e 100644 --- a/.github/workflows/update-subtrees.yml +++ b/.github/workflows/update-subtrees.yml @@ -9,6 +9,10 @@ env: MONOREPO_URL: github.com/ROCm/rocm-libraries.git MONOREPO_BRANCH: develop +concurrency: + group: pr-fanout-${{ env.MONOREPO_BRANCH }} + cancel-in-progress: false + jobs: synchronize-subtrees: runs-on: ubuntu-24.04 @@ -32,6 +36,10 @@ jobs: git config user.name "assistant-librarian[bot]" git config user.email "assistant-librarian[bot]@users.noreply.github.com" + - name: Switch to the Monorepo branch + run: | + git checkout -B "${{ env.MONOREPO_BRANCH }}" "origin/${{ env.MONOREPO_BRANCH }}" + - name: Update Repositories in the Monorepo run: | has_errors=false @@ -47,9 +55,12 @@ jobs: } fi if [ "$enable_push" = true ]; then - git subtree push --prefix "${category}/${repo}" https://github.com/${url}.git $branch --quiet || { + git fetch origin subtrees/${repo}/${branch} + git subtree split --prefix="${category}/${repo}" -b subtrees/${repo}/${branch} --rejoin || { has_errors=true } + git push origin subtrees/${repo}/${branch} + git push https://github.com/${url}.git subtrees/${repo}/${branch}:${branch} fi done