ci: add mirror-osp-to-ooc.yaml [auto] #193
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: Mirror to OpenOS-Project-Ecosystem-OOC | |
| # Sync chain: | |
| # Interested-Deving-1896 ->(upstream mirror.yaml)-> OpenOS-Project-OSP | |
| # OpenOS-Project-OSP ->(this file)-> OpenOS-Project-Ecosystem-OOC | |
| on: | |
| push: | |
| branches: ["**"] | |
| tags: ["**"] | |
| schedule: | |
| # Runs 15 minutes after the upstream->OSP sync to allow OSP to settle | |
| - cron: "15 * * * *" | |
| workflow_dispatch: | |
| jobs: | |
| mirror: | |
| runs-on: ubuntu-latest | |
| # Only run when executing in the OSP repo — no-op if mirrored elsewhere | |
| if: github.repository == 'OpenOS-Project-OSP/talos' | |
| steps: | |
| - name: Checkout full history | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Fetch all branches and tags | |
| run: git fetch --all --tags --prune | |
| - name: Push mirror to OpenOS-Project-Ecosystem-OOC | |
| env: | |
| MIRROR_TOKEN: ${{ secrets.MIRROR_TOKEN }} | |
| run: | | |
| git config --global credential.helper store | |
| printf 'https://x-access-token:%s@github.com\n' "$MIRROR_TOKEN" \ | |
| > ~/.git-credentials | |
| git remote add mirror \ | |
| "https://github.com/OpenOS-Project-Ecosystem-OOC/talos.git" | |
| git push mirror --all --force | |
| git push mirror --tags --force | |
| rm -f ~/.git-credentials |