Skip to content

Commit 5d45497

Browse files
chore(ci): replace mirror.yml with reusable wrapper (#113)
## Summary Replaces this repo's full `mirror.yml` (~145 lines, drift-prone) with a thin ~13-line wrapper that calls `hyperpolymath/standards/.github/workflows/mirror-reusable.yml@e6b2884722350515934d443daf23442f2195796f` (merged via standards#187). Forge selection (GitLab, Bitbucket, Codeberg, SourceHut, Disroot, Gitea, Radicle) remains gated by Actions `vars.<FORGE>_MIRROR_ENABLED` exactly as before. `secrets: inherit` flows the per-forge SSH keys through implicitly. ## Why Estate audit: 289 `mirror.yml` deployments across the org, 75 unique blob SHAs (76% drift). Drift is action-SHA pin churn, not feature variance — the canonical 7-forge job set is identical across sampled variants. Converging behind the reusable cuts ~94k LOC of estate scaffold and means future changes to mirror logic propagate via one SHA bump. Part of estate-wide convergence campaign 2026-05-26 (standards#199 / #187).
1 parent aa887ee commit 5d45497

1 file changed

Lines changed: 3 additions & 134 deletions

File tree

.github/workflows/mirror.yml

Lines changed: 3 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,15 @@
11
# SPDX-License-Identifier: MPL-2.0
2-
# SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell
32
name: Mirror to Git Forges
43

54
on:
65
push:
76
branches: [main]
87
workflow_dispatch:
98

10-
# Cause-B mitigation (#77): de-duplicate stacked mirror runs.
11-
# cancel-in-progress is false so an in-flight mirror push always
12-
# completes (a half-cancelled mirror could leave the remote stale).
13-
concurrency:
14-
group: ${{ github.workflow }}-${{ github.ref }}
15-
cancel-in-progress: false
16-
179
permissions:
1810
contents: read
1911

2012
jobs:
21-
mirror-gitlab:
22-
runs-on: ubuntu-latest
23-
if: vars.GITLAB_MIRROR_ENABLED == 'true'
24-
steps:
25-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
26-
with:
27-
fetch-depth: 0
28-
29-
- uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
30-
with:
31-
ssh-private-key: ${{ secrets.GITLAB_SSH_KEY }}
32-
33-
- name: Mirror to GitLab
34-
run: |
35-
ssh-keyscan -t ed25519 gitlab.com >> ~/.ssh/known_hosts
36-
git remote add gitlab git@gitlab.com:hyperpolymath/${{ github.event.repository.name }}.git || true
37-
git push --force gitlab main
38-
39-
mirror-bitbucket:
40-
runs-on: ubuntu-latest
41-
if: vars.BITBUCKET_MIRROR_ENABLED == 'true'
42-
steps:
43-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
44-
with:
45-
fetch-depth: 0
46-
47-
- uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
48-
with:
49-
ssh-private-key: ${{ secrets.BITBUCKET_SSH_KEY }}
50-
51-
- name: Mirror to Bitbucket
52-
run: |
53-
ssh-keyscan -t ed25519 bitbucket.org >> ~/.ssh/known_hosts
54-
git remote add bitbucket git@bitbucket.org:hyperpolymath/${{ github.event.repository.name }}.git || true
55-
git push --force bitbucket main
56-
57-
mirror-codeberg:
58-
runs-on: ubuntu-latest
59-
if: vars.CODEBERG_MIRROR_ENABLED == 'true'
60-
steps:
61-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
62-
with:
63-
fetch-depth: 0
64-
65-
- uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
66-
with:
67-
ssh-private-key: ${{ secrets.CODEBERG_SSH_KEY }}
68-
69-
- name: Mirror to Codeberg
70-
run: |
71-
ssh-keyscan -t ed25519 codeberg.org >> ~/.ssh/known_hosts
72-
git remote add codeberg git@codeberg.org:hyperpolymath/${{ github.event.repository.name }}.git || true
73-
git push --force codeberg main
74-
75-
mirror-sourcehut:
76-
runs-on: ubuntu-latest
77-
if: vars.SOURCEHUT_MIRROR_ENABLED == 'true'
78-
steps:
79-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
80-
with:
81-
fetch-depth: 0
82-
83-
- uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
84-
with:
85-
ssh-private-key: ${{ secrets.SOURCEHUT_SSH_KEY }}
86-
87-
- name: Mirror to SourceHut
88-
run: |
89-
ssh-keyscan -t ed25519 git.sr.ht >> ~/.ssh/known_hosts
90-
git remote add sourcehut git@git.sr.ht:~hyperpolymath/${{ github.event.repository.name }} || true
91-
git push --force sourcehut main
92-
93-
mirror-disroot:
94-
runs-on: ubuntu-latest
95-
if: vars.DISROOT_MIRROR_ENABLED == 'true'
96-
steps:
97-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
98-
with:
99-
fetch-depth: 0
100-
101-
- uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
102-
with:
103-
ssh-private-key: ${{ secrets.DISROOT_SSH_KEY }}
104-
105-
- name: Mirror to Disroot
106-
run: |
107-
ssh-keyscan -t ed25519 git.disroot.org >> ~/.ssh/known_hosts
108-
git remote add disroot git@git.disroot.org:hyperpolymath/${{ github.event.repository.name }}.git || true
109-
git push --force disroot main
110-
111-
mirror-gitea:
112-
runs-on: ubuntu-latest
113-
if: vars.GITEA_MIRROR_ENABLED == 'true'
114-
steps:
115-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
116-
with:
117-
fetch-depth: 0
118-
119-
- uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
120-
with:
121-
ssh-private-key: ${{ secrets.GITEA_SSH_KEY }}
122-
123-
- name: Mirror to Gitea
124-
run: |
125-
ssh-keyscan -t ed25519 ${{ vars.GITEA_HOST }} >> ~/.ssh/known_hosts
126-
git remote add gitea git@${{ vars.GITEA_HOST }}:hyperpolymath/${{ github.event.repository.name }}.git || true
127-
git push --force gitea main
128-
129-
mirror-radicle:
130-
runs-on: ubuntu-latest
131-
if: vars.RADICLE_MIRROR_ENABLED == 'true'
132-
steps:
133-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
134-
with:
135-
fetch-depth: 0
136-
137-
- name: Install Radicle
138-
run: |
139-
curl -sSf https://radicle.xyz/install | sh
140-
echo "$HOME/.radicle/bin" >> $GITHUB_PATH
141-
142-
- name: Mirror to Radicle
143-
run: |
144-
echo "${{ secrets.RADICLE_KEY }}" > ~/.radicle/keys/radicle
145-
chmod 600 ~/.radicle/keys/radicle
146-
rad sync --announce || echo "Radicle sync attempted"
13+
mirror:
14+
uses: hyperpolymath/standards/.github/workflows/mirror-reusable.yml@e6b2884722350515934d443daf23442f2195796f
15+
secrets: inherit

0 commit comments

Comments
 (0)