diff --git a/.github/workflows/mkdocs.yaml b/.github/workflows/mkdocs.yaml index 172f9c7d8..56ef19f7d 100644 --- a/.github/workflows/mkdocs.yaml +++ b/.github/workflows/mkdocs.yaml @@ -35,14 +35,15 @@ jobs: fetch-depth: 0 - name: Update Gitlab Documentation run: | - LATEST_TAG=$(git rev-parse $GITHUB_REF) - BRANCH_NAME="documentation-ref_$LATEST_TAG" + CURRENT_GH_BRANCH=$(git branch --show-current) + LATEST_TAG=$(git rev-parse $CURRENT_GH_BRANCH) + GL_BRANCH_NAME="documentation-ref_$CURRENT_GH_BRANCH" git config user.name ${{ secrets.GITLAB_USER }} git config user.email ${{ secrets.GITLAB_EMAIL }} git remote set-url origin ${{ secrets.GITLAB_DOC_URL }} git checkout -b $BRANCH_NAME git cherry-pick -n $LATEST_TAG - git reset --hard HEAD + git reset $(git merge-base $CURRENT_GH_BRANCH $GL_BRANCH_NAME) git add \*.md docs/ git commit --allow-empty -m "Created by $GITHUB_ACTOR" git push origin $BRANCH_NAME