Sync Registered Imports #647
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: Sync Registered Imports | |
| # Re-syncs all repos registered in registered-imports.json. | |
| # For each entry, bare-clones the source URL and pushes all branches + tags | |
| # to the Interested-Deving-1896 counterpart. | |
| on: | |
| schedule: | |
| - cron: '55 * * * *' # Hourly at :55 | |
| workflow_dispatch: | |
| inputs: | |
| repo_filter: | |
| description: "Repo name substring filter (blank = all)" | |
| required: false | |
| default: "" | |
| type: string | |
| dry_run: | |
| description: "Report without pushing" | |
| required: false | |
| default: false | |
| type: boolean | |
| source_filter: | |
| description: "Only sync entries from this source host (github/gitlab/gitea/bitbucket)" | |
| required: false | |
| default: "" | |
| type: choice | |
| options: | |
| - "" | |
| - github | |
| - gitlab | |
| - gitea | |
| - bitbucket | |
| rate_limit_rerun: | |
| description: "Set by rate-limit-rerun workflow — prevents re-trigger loops" | |
| required: false | |
| default: "false" | |
| type: string | |
| permissions: | |
| contents: write | |
| # ── Rate limits ────────────────────────────────────────────────────────────── | |
| # No REST API polling — only git clone from source + git push to GitHub. | |
| # git_push_retry() retries up to 3 times with linear backoff (15 s, 30 s, | |
| # 45 s) on any push failure. Clone failures are logged and skipped; the | |
| # entry will be retried on the next hourly run. | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Sync registered imports | |
| env: | |
| GH_TOKEN: ${{ secrets.SYNC_TOKEN }} | |
| GITHUB_OWNER: Interested-Deving-1896 | |
| GITLAB_TOKEN: ${{ secrets.GITLAB_SYNC_TOKEN }} | |
| BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }} | |
| GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} | |
| REPO_FILTER: ${{ inputs.repo_filter || '' }} | |
| DRY_RUN: ${{ inputs.dry_run || 'false' }} | |
| SOURCE_FILTER: ${{ inputs.source_filter || '' }} | |
| run: bash scripts/sync-registered-imports.sh | |
| - name: Write summary | |
| if: always() | |
| env: | |
| JOB_STATUS: ${{ job.status }} | |
| INPUTS_JSON: ${{ toJSON(inputs) }} | |
| run: bash scripts/write-summary.sh |