Mercurial > hg > orthanc-databases
view .github/workflows/mirror.yml @ 834:856861bebd74 default tip
fix
| author | Alain Mazy <am@orthanc.team> |
|---|---|
| date | Wed, 19 Aug 2026 09:07:29 +0200 |
| parents | baf483a8adea |
| children |
line wrap: on
line source
name: Mirror Mercurial to GitHub env: HG_SOURCE_URL: https://orthanc.uclouvain.be/hg/orthanc-databases/ GITHUB_TARGET: jodogne/mirror-orthanc-databases FAST_EXPORT_VERSION: fast-export-260405 on: schedule: - cron: '10 2 * * *' workflow_dispatch: {} concurrency: group: hg-mirror cancel-in-progress: false permissions: contents: write # GITHUB_TOKEN is read-only by default; this grants push access jobs: mirror: if: ${{ github.repository == 'jodogne/mirror-orthanc-databases' }} runs-on: ubuntu-slim steps: - name: Install Mercurial and fast-export run: | sudo apt-get update DEBIAN_FRONTEND=noninteractive sudo apt-get install -y mercurial git wget cd /tmp/ wget https://orthanc.uclouvain.be/downloads/third-party-downloads/${FAST_EXPORT_VERSION}.tar.gz tar xvf ${FAST_EXPORT_VERSION}.tar.gz - name: Full clone of Mercurial source run: | hg clone "${HG_SOURCE_URL}" hg-repo - name: Full conversion (fresh git repo every run) run: | git init --bare git-repo cd git-repo /tmp/${FAST_EXPORT_VERSION}/hg-fast-export.sh -r ../hg-repo --hg-hash --hgtags - name: Push (never force, so it can't rewrite or delete history) env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cd git-repo git remote add origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_TARGET}" git push origin 'refs/heads/*:refs/heads/*' git push origin 'refs/tags/*:refs/tags/*' if git rev-parse --verify refs/notes/hg >/dev/null 2>&1; then git push origin refs/notes/hg:refs/notes/hg fi
