Setup OSP Mirror Workflows #15
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: Setup OSP Mirror Workflows | |
| # Runs hourly and on demand. For every repo that exists on both | |
| # Interested-Deving-1896 and OpenOS-Project-OSP, ensures the OSP copy has: | |
| # - mirror.yaml disabled (OSP is not the push source) | |
| # - mirror-osp-to-ooc.yaml active with correct content | |
| # - MIRROR_TOKEN secret set | |
| # New repos imported to OSP from upstream are picked up automatically. | |
| # After setup, rewrites Interested-Deving-1896 references in OSP + OOC | |
| # mirror repos so URLs and comments point to the correct org. | |
| on: | |
| schedule: | |
| - cron: "45 * * * *" # Hourly at :45 | |
| workflow_dispatch: | |
| inputs: | |
| repo_filter: | |
| description: "Repo name substring filter (blank = all)" | |
| required: false | |
| default: "" | |
| dry_run: | |
| description: "Dry run — print actions without applying changes" | |
| type: boolean | |
| required: false | |
| default: false | |
| permissions: | |
| contents: read | |
| # ── Rate limits ────────────────────────────────────────────────────────────── | |
| # GitHub REST API (SYNC_TOKEN): 5 000 req/hr primary limit. | |
| # setup-osp-mirrors.sh retries HTTP 403/429 up to 3 times, sleeping until | |
| # X-RateLimit-Reset (reads header from each response). | |
| # Secret encryption uses PyNaCl locally — the only extra API call is the | |
| # PUT /actions/secrets endpoint, which counts against the primary quota. | |
| jobs: | |
| setup: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup OSP mirror workflows | |
| env: | |
| GH_TOKEN: ${{ secrets.SYNC_TOKEN }} | |
| UPSTREAM_OWNER: Interested-Deving-1896 | |
| OSP_ORG: OpenOS-Project-OSP | |
| OOC_ORG: OpenOS-Project-Ecosystem-OOC | |
| REPO_FILTER: ${{ inputs.repo_filter || '' }} | |
| DRY_RUN: ${{ inputs.dry_run || 'false' }} | |
| run: | | |
| if [[ -z "${GH_TOKEN}" ]]; then | |
| echo "SYNC_TOKEN not configured — skipping." | |
| exit 0 | |
| fi | |
| bash scripts/setup-osp-mirrors.sh | |
| - name: Write summary | |
| if: always() | |
| env: | |
| JOB_STATUS: ${{ job.status }} | |
| INPUTS_JSON: ${{ toJSON(inputs) }} | |
| run: bash scripts/write-summary.sh |