development #2
@ -8,7 +8,10 @@
|
|||||||
# SVN_REPO_URL – Base SVN repo URL (e.g. https://svn.example.com/repos/myproject)
|
# SVN_REPO_URL – Base SVN repo URL (e.g. https://svn.example.com/repos/myproject)
|
||||||
|
|
||||||
name: Sync to SVN
|
name: Sync to SVN
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
push-to-svn:
|
push-to-svn:
|
||||||
@ -51,3 +54,24 @@ jobs:
|
|||||||
--exclude='.svn/' \
|
--exclude='.svn/' \
|
||||||
--exclude='svn-branch/' \
|
--exclude='svn-branch/' \
|
||||||
. svn-branch/
|
. svn-branch/
|
||||||
|
- name: Stage and commit to SVN
|
||||||
|
run: |
|
||||||
|
cd svn-branch
|
||||||
|
|
||||||
|
# Add all new/unversioned files and directories in one pass
|
||||||
|
svn add --force .
|
||||||
|
|
||||||
|
# Delete files removed from git (handles paths with spaces).
|
||||||
|
# '|| true' prevents pipefail aborting when grep finds no '!' lines.
|
||||||
|
svn status | grep '^!' | while IFS= read -r line; do
|
||||||
|
svn delete "${line:8}@"
|
||||||
|
done || true
|
||||||
|
|
||||||
|
# Attempt commit; svn commit exits 0 silently when nothing changed
|
||||||
|
svn commit \
|
||||||
|
--username "${{ secrets.SVN_USERNAME }}" \
|
||||||
|
--password "${{ secrets.SVN_PASSWORD }}" \
|
||||||
|
--no-auth-cache \
|
||||||
|
--non-interactive \
|
||||||
|
--trust-server-cert \
|
||||||
|
-m "Gitea CI sync from commit ${{ github.sha }} [ci skip]"
|
||||||
Loading…
Reference in New Issue
Block a user