Skip to content

Commit 37778fd

Browse files
committed
ci(workflows): presence-gate mirror SSH steps + correct registry-verify licence
- mirror-reusable.yml: gate each forge's webfactory/ssh-agent step AND its push step on secrets.<FORGE>_SSH_KEY != '' (matching the existing Radicle pattern). Resolves Hypatia secret_action_without_presence_gate (high) and makes an enabled-but-keyless mirror a clean no-op rather than a hard failure. - registry-verify.yml: SPDX AGPL-3.0-or-later -> MPL-2.0 (owner-directed; aligns with its 27 sibling workflows; clears Hypatia agpl_license). Note: scorecard_publish_with_run_step on scorecard-enforcer.yml is a Hypatia false positive — the publish job is already uses-only with the threshold check split into a downstream check-score job. https://claude.ai/code/session_01AmPXB2dA2wCcabo8BXwS28
1 parent 9726a38 commit 37778fd

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/mirror-reusable.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ jobs:
5656
with:
5757
fetch-depth: 0
5858
- uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
59+
if: ${{ secrets.GITLAB_SSH_KEY != '' }}
5960
with:
6061
ssh-private-key: ${{ secrets.GITLAB_SSH_KEY }}
6162
- name: Mirror to GitLab
63+
if: ${{ secrets.GITLAB_SSH_KEY != '' }}
6264
# continue-on-error: GitLab branch protection on the mirror repo may block
6365
# force-push even for a deploy key. Owner action required: in GitLab go to
6466
# Settings → Repository → Protected branches → main and either allow force-push
@@ -79,9 +81,11 @@ jobs:
7981
with:
8082
fetch-depth: 0
8183
- uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
84+
if: ${{ secrets.BITBUCKET_SSH_KEY != '' }}
8285
with:
8386
ssh-private-key: ${{ secrets.BITBUCKET_SSH_KEY }}
8487
- name: Mirror to Bitbucket
88+
if: ${{ secrets.BITBUCKET_SSH_KEY != '' }}
8589
run: |
8690
ssh-keyscan -t ed25519 bitbucket.org >> ~/.ssh/known_hosts
8791
git remote add bitbucket git@bitbucket.org:hyperpolymath/${{ github.event.repository.name }}.git || true
@@ -96,9 +100,11 @@ jobs:
96100
with:
97101
fetch-depth: 0
98102
- uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
103+
if: ${{ secrets.CODEBERG_SSH_KEY != '' }}
99104
with:
100105
ssh-private-key: ${{ secrets.CODEBERG_SSH_KEY }}
101106
- name: Mirror to Codeberg
107+
if: ${{ secrets.CODEBERG_SSH_KEY != '' }}
102108
run: |
103109
ssh-keyscan -t ed25519 codeberg.org >> ~/.ssh/known_hosts
104110
git remote add codeberg git@codeberg.org:hyperpolymath/${{ github.event.repository.name }}.git || true
@@ -113,9 +119,11 @@ jobs:
113119
with:
114120
fetch-depth: 0
115121
- uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
122+
if: ${{ secrets.SOURCEHUT_SSH_KEY != '' }}
116123
with:
117124
ssh-private-key: ${{ secrets.SOURCEHUT_SSH_KEY }}
118125
- name: Mirror to SourceHut
126+
if: ${{ secrets.SOURCEHUT_SSH_KEY != '' }}
119127
run: |
120128
ssh-keyscan -t ed25519 git.sr.ht >> ~/.ssh/known_hosts
121129
git remote add sourcehut git@git.sr.ht:~hyperpolymath/${{ github.event.repository.name }} || true
@@ -130,9 +138,11 @@ jobs:
130138
with:
131139
fetch-depth: 0
132140
- uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
141+
if: ${{ secrets.DISROOT_SSH_KEY != '' }}
133142
with:
134143
ssh-private-key: ${{ secrets.DISROOT_SSH_KEY }}
135144
- name: Mirror to Disroot
145+
if: ${{ secrets.DISROOT_SSH_KEY != '' }}
136146
run: |
137147
ssh-keyscan -t ed25519 git.disroot.org >> ~/.ssh/known_hosts
138148
git remote add disroot git@git.disroot.org:hyperpolymath/${{ github.event.repository.name }}.git || true
@@ -147,9 +157,11 @@ jobs:
147157
with:
148158
fetch-depth: 0
149159
- uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
160+
if: ${{ secrets.GITEA_SSH_KEY != '' }}
150161
with:
151162
ssh-private-key: ${{ secrets.GITEA_SSH_KEY }}
152163
- name: Mirror to Gitea
164+
if: ${{ secrets.GITEA_SSH_KEY != '' }}
153165
run: |
154166
ssh-keyscan -t ed25519 ${{ vars.GITEA_HOST }} >> ~/.ssh/known_hosts
155167
git remote add gitea git@${{ vars.GITEA_HOST }}:hyperpolymath/${{ github.event.repository.name }}.git || true

.github/workflows/registry-verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-License-Identifier: AGPL-3.0-or-later
1+
# SPDX-License-Identifier: MPL-2.0
22
# registry-verify — fail the build if the spec registry or the DERIVED
33
# topology map has drifted from the file tree. This is the in-repo half of
44
# the drift-detection loop (the estate half is Hypatia rule HYP-S006).

0 commit comments

Comments
 (0)