SVN Sync #1028
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SVN Sync | |
| on: | |
| schedule: | |
| - cron: '0 * * * *' | |
| workflow_dispatch: | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate token | |
| id: app-token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| owner: ooRexx | |
| repositories: ooRexx | |
| - name: Install git-svn | |
| run: | | |
| sudo add-apt-repository -y ppa:git-core/ppa | |
| sudo apt-get update | |
| sudo apt-get install -y git-svn | |
| - name: Clone mirror repo | |
| run: git clone --bare https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/ooRexx/ooRexx.git repo | |
| - name: Restore SVN metadata cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: repo/svn | |
| key: git-svn-metadata | |
| - name: Configure git-svn | |
| working-directory: repo | |
| run: | | |
| git config svn-remote.svn.url https://svn.code.sf.net/p/oorexx/code-0 | |
| git config svn-remote.svn.fetch main/trunk:refs/remotes/git-svn | |
| git update-ref refs/remotes/git-svn refs/heads/master | |
| - name: Fetch from SVN | |
| working-directory: repo | |
| run: git svn fetch | |
| - name: Update master | |
| working-directory: repo | |
| run: git update-ref refs/heads/master refs/remotes/git-svn | |
| - name: Push | |
| working-directory: repo | |
| run: git push origin master |