2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-25 16:05:19 +00:00

Try to fix revision walk error (#25)

* Update mirror.yml

try adding unshallow to avoid error

* Update mirror.yml

push using git commandline instead of unmaintained action

* Update mirror.yml

cleanup cache option added
This commit is contained in:
sidey79 2022-02-20 21:17:29 +01:00 committed by GitHub
parent 4deeddeb9e
commit c84dc390da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,8 +16,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
continue-on-error: true continue-on-error: true
env:
TRAVIS_REPO_SLUG: ${{ github.repository }}
steps: steps:
- name: install git-svn package - name: install git-svn package
@ -54,6 +52,13 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-fhemsvndir- ${{ runner.os }}-fhemsvndir-
- name: clean cache
env:
Clean_Cache: ${{ secrets.CLEANCACHE }}
if: "${{ env.Clean_Cache == 'true' }}"
run: |
rm -r ./src/fhem-mirror/.git
#- name: 'Tar files' #- name: 'Tar files'
# run: tar -cvf ${GITHUB_WORKSPACE}/svnMirror.tar ./src/fhem-mirror/ # run: tar -cvf ${GITHUB_WORKSPACE}/svnMirror.tar ./src/fhem-mirror/
@ -71,7 +76,7 @@ jobs:
git svn init --trunk=trunk --tags=tags --prefix=svn/ https://svn.fhem.de/fhem; git svn init --trunk=trunk --tags=tags --prefix=svn/ https://svn.fhem.de/fhem;
git config --replace-all svn-remote.svn.preserve-empty-dirs "true" ; git config --replace-all svn-remote.svn.preserve-empty-dirs "true" ;
git config --replace-all svn-remote.svn.placeholder-filename ".gitkeep" ; git config --replace-all svn-remote.svn.placeholder-filename ".gitkeep" ;
git config --replace-all svn.authorsfile "${GITHUB_WORKSPACE}/authors_merged.txt" ; git config --replace-all svn.authorsfile "${GITHUB_WORKSPACE}/authors/authors_merged.txt" ;
# Run extra fetches after init, go pick up some base refs for the cache on first run only! # Run extra fetches after init, go pick up some base refs for the cache on first run only!
timeout 300 git svn -q fetch || timeout 300 git svn -q fetch || timeout 300 git svn -q fetch || true timeout 300 git svn -q fetch || timeout 300 git svn -q fetch || timeout 300 git svn -q fetch || true
else else
@ -120,12 +125,11 @@ jobs:
# git branch -r -d origin/tags/$BRANCH # git branch -r -d origin/tags/$BRANCH
done done
- name: Push force changes to master branch in same repo - name: push tags and commits into master branch (force)
if: ${{ steps.fetchsvn.outputs.SVN_FETCH_STATUS == 'complete' }} if: ${{ steps.fetchsvn.outputs.SVN_FETCH_STATUS == 'complete' }}
uses: ad-m/github-push-action@v0.6.0 working-directory: ./src/fhem-mirror
with: run: |
github_token: ${{ secrets.GITHUB_TOKEN }} git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
branch: master git fetch --unshallow || true
directory: ./src/fhem-mirror git push origin master --force --tags
force: true
tags: true