@@ -118,32 +118,44 @@ jobs:
118118 git add .gitattributes
119119 git commit -m "Ensure LFS tracking for large JAR files" || echo "No changes to commit"
120120
121- - name : Clone target repository
121+ - name : Clone target repository and push changes
122122 run : |
123+ # Clone the repository
123124 git clone https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/CheckmarxDev/ast-eclipse-plugin-update-site.git update-site
124125 cd update-site
126+
127+ # Ensure Git LFS is installed
125128 git lfs install
126129
127- # Fetch all branches from the remote repository
130+ # Configure Git user to prevent commit errors
131+ git config --global user.email "cylon-bot@checkmarx.com"
132+ git config --global user.name "cylon-bot"
133+
134+ # Fetch all branches
128135 git fetch --all
129136
130- # Ensure the branch exists locally by checking remote references
137+ # Ensure the branch exists and check it out
131138 if git show-ref --verify --quiet refs/remotes/origin/${{ env.GH_BRANCH_NAME }}; then
132139 echo "Branch ${{ env.GH_BRANCH_NAME }} exists remotely."
133140 git checkout -B ${{ env.GH_BRANCH_NAME }} origin/${{ env.GH_BRANCH_NAME }}
134141 else
135142 echo "Branch ${{ env.GH_BRANCH_NAME }} does not exist remotely."
136143 exit 1
137144 fi
138-
139- cd ..
140- rsync -av --delete . /com.checkmarx.eclipse.site/target/repository/ ./update-site /
141-
142- cd update-site
145+
146+ # Copy new files without deleting .git directory
147+ rsync -av --delete --exclude='.git' .. /com.checkmarx.eclipse.site/target/repository/ ./
148+
149+ # Add and commit changes
143150 git add .
144151 git commit -m "Update Eclipse update site for ${{ env.GH_RELEASE_TAG_NAME }}" || echo "No changes to commit"
152+
153+ # Ensure the correct remote URL
145154 git remote set-url origin https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/CheckmarxDev/ast-eclipse-plugin-update-site.git
155+
156+ # Push changes
146157 git push origin ${{ env.GH_BRANCH_NAME }}
158+
147159
148160 notify :
149161 if : ${{ inputs.rbranch == '' || inputs.rbranch == null }}
0 commit comments