diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml index 17aa24d99..e87ec559c 100644 --- a/.github/workflows/mirror.yml +++ b/.github/workflows/mirror.yml @@ -105,18 +105,20 @@ jobs: echo "A permanent error occured" exit 1 - # - name: Recreate tags from svn - # run: | - # for tag in `git branch -r | grep "tags/" | sed 's/ tags\///'`; do - # git tag -a -m"Converting SVN tags" $tag refs/remotes/$tag - # done - - # - name: Commit fetched files - # run: | - # cd "${GITHUB_WORKSPACE}/src/fhem-mirror"; - # echo "Will now prepare push following directory structure to remote repo:"; - # ls -la ; - # git config --add remote.origin.push 'refs/remotes/svn/trunk:refs/heads/master'; + - name: Recreate tags from svn + if: ${{ steps.fetchsvn.outputs.SVN_FETCH_STATUS == 'complete' }} + working-directory: ./src/fhem-mirror + run: | + git for-each-ref --format="%(refname:lstrip=-1) %(objectname)" refs/remotes/svn/tags/FHEM_*_? \ + | while read BRANCH REF + do + TAG_NAME=${BRANCH#FHEM_} + TAG_NAME=$(echo $TAG_NAME | sed 's/_/./g') + BODY="$(git log -1 --format=format:%B $REF)" + echo "branch=$BRANCH ref=$REF parent=$(git rev-parse $REF^) tagname=$TAG_NAME body=$BODY" >&2 + git tag -a -f -m "$BODY" $TAG_NAME $REF^ + # git branch -r -d origin/tags/$BRANCH + done - name: Push force changes to master branch in same repo if: ${{ steps.fetchsvn.outputs.SVN_FETCH_STATUS == 'complete' }} diff --git a/README.md b/README.md index fa647ea15..84e8c9f9e 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # fhem-mirror -READ-ONLY mirror of the [main Subversion repository trunk](http://svn.fhem.de/fhem/trunk), updated daily. +READ-ONLY mirror of the [main Subversion repository](http://svn.fhem.de/fhem/trunk), updated multiple times every day. ## Branches 1. The [`master`](https://github.com/fhem/fhem-mirror/tree/master) branch hosts the current source code from [FHEM SVN Trunk](http://svn.fhem.de/fhem/trunk). 2. The [`travis`](https://github.com/fhem/fhem-mirror/tree/travis) branch is controlling the mirroring process, running on [Github Actions](https://github.com/fhem/fhem-mirror/actions/workflows/mirror.yml). +3. Under [`tags`](https://github.com/fhem/fhem-mirror/tags) FHEM Releases are mirrored also. ## Pull requests Pull requests to any other branch besides [`travis`](https://github.com/fhem/fhem-mirror/tree/travis) will be rejected.