Skip to content

Commit 05f8540

Browse files
hyperpolymathclaude
andcommitted
fix(ci): bind forge SSH key to SSH_PRIVATE_KEY env so mirror guards work
mirror.yml guarded each forge's ssh-agent step with `if: ${{ env.SSH_PRIVATE_KEY != '' }}` but SSH_PRIVATE_KEY was never defined (no env: block, no $GITHUB_ENV write) — so the guard was permanently false, ssh-agent never loaded, and every enabled mirror push ran keyless and failed silently. Binds each job's real secret (secrets.<FORGE>_SSH_KEY) to a job-level SSH_PRIVATE_KEY env so the existing guard evaluates correctly per forge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1c30fd6 commit 05f8540

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/mirror.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
timeout-minutes: 15
1414
if: vars.GITLAB_MIRROR_ENABLED == 'true'
15+
env:
16+
SSH_PRIVATE_KEY: ${{ secrets.GITLAB_SSH_KEY }}
1517
steps:
1618
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1719
with:
@@ -29,6 +31,8 @@ jobs:
2931
runs-on: ubuntu-latest
3032
timeout-minutes: 15
3133
if: vars.BITBUCKET_MIRROR_ENABLED == 'true'
34+
env:
35+
SSH_PRIVATE_KEY: ${{ secrets.BITBUCKET_SSH_KEY }}
3236
steps:
3337
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3438
with:
@@ -46,6 +50,8 @@ jobs:
4650
runs-on: ubuntu-latest
4751
timeout-minutes: 15
4852
if: vars.CODEBERG_MIRROR_ENABLED == 'true'
53+
env:
54+
SSH_PRIVATE_KEY: ${{ secrets.CODEBERG_SSH_KEY }}
4955
steps:
5056
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5157
with:
@@ -63,6 +69,8 @@ jobs:
6369
runs-on: ubuntu-latest
6470
timeout-minutes: 15
6571
if: vars.SOURCEHUT_MIRROR_ENABLED == 'true'
72+
env:
73+
SSH_PRIVATE_KEY: ${{ secrets.SOURCEHUT_SSH_KEY }}
6674
steps:
6775
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6876
with:
@@ -80,6 +88,8 @@ jobs:
8088
runs-on: ubuntu-latest
8189
timeout-minutes: 15
8290
if: vars.DISROOT_MIRROR_ENABLED == 'true'
91+
env:
92+
SSH_PRIVATE_KEY: ${{ secrets.DISROOT_SSH_KEY }}
8393
steps:
8494
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8595
with:
@@ -97,6 +107,8 @@ jobs:
97107
runs-on: ubuntu-latest
98108
timeout-minutes: 15
99109
if: vars.GITEA_MIRROR_ENABLED == 'true'
110+
env:
111+
SSH_PRIVATE_KEY: ${{ secrets.GITEA_SSH_KEY }}
100112
steps:
101113
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
102114
with:

0 commit comments

Comments
 (0)