You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ci): hoist secrets to job env in mirror-reusable; refresh example SHAs (#416)
## Task A — mirror-reusable.yml (two real bugs)
**Bug 1 — duplicate `if:` key.** The "Mirror to GitLab" step had `if:
${{ secrets.GITLAB_SSH_KEY != '' }}` twice (with `continue-on-error:
true` between). Removed the duplicate so the step has exactly one `if:`.
**Bug 2 — `secrets` context in step `if:`.** The `secrets` context is
**not** valid in step-level `if:` — it is an `Unrecognized named-value:
'secrets'` startup failure. Hoisted each forge secret to a job-level
`env:` block and changed every step `if:` to gate on `env.<FORGE>_KEY`,
matching the already-correct `mirror-radicle` job. Applied to all six
forge jobs: gitlab, bitbucket, codeberg, sourcehut, disroot, gitea.
Behaviour is identical; only the reference site moved. `actionlint`
clean.
## Task B — refresh stale example SHAs
The header copy-paste usage examples in
`{elixir-ci,deno-ci,rust-ci,changelog}-reusable.yml` pinned `@861b5e9…`
(stale, ~70 commits behind, beyond the staleness window). Refreshed to
current `main` HEAD `4762ba66441de05bccb36e074ba3d2202219126a`.
Comment-only.
## Validation
- `actionlint` clean on all 5 files.
- No `secrets.*` remains in any step `if:`.
- Task B diff is comment-only.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
echo "::notice::GITLAB_MIRROR_ENABLED=true but secrets.GITLAB_SSH_KEY is empty. Skipping GitLab mirror. Configure the GITLAB_SSH_KEY org/repo secret to enable."
79
84
80
85
mirror-bitbucket:
81
86
timeout-minutes: 20
82
87
runs-on: ${{ inputs.runs-on }}
83
88
if: vars.BITBUCKET_MIRROR_ENABLED == 'true'
89
+
# See mirror-gitlab: the `secrets` context is not valid in step `if:`;
90
+
# hoist to job-level `env` and gate steps on `env.BITBUCKET_KEY`.
- name: Skipped (BITBUCKET_SSH_KEY not configured)
99
-
if: ${{ secrets.BITBUCKET_SSH_KEY == '' }}
108
+
if: ${{ env.BITBUCKET_KEY == '' }}
100
109
run: |
101
110
echo "::notice::BITBUCKET_MIRROR_ENABLED=true but secrets.BITBUCKET_SSH_KEY is empty. Skipping Bitbucket mirror. Configure the BITBUCKET_SSH_KEY org/repo secret to enable."
102
111
103
112
mirror-codeberg:
104
113
timeout-minutes: 20
105
114
runs-on: ${{ inputs.runs-on }}
106
115
if: vars.CODEBERG_MIRROR_ENABLED == 'true'
116
+
# See mirror-gitlab: the `secrets` context is not valid in step `if:`;
117
+
# hoist to job-level `env` and gate steps on `env.CODEBERG_KEY`.
echo "::notice::CODEBERG_MIRROR_ENABLED=true but secrets.CODEBERG_SSH_KEY is empty. Skipping Codeberg mirror. Configure the CODEBERG_SSH_KEY org/repo secret to enable."
125
138
126
139
mirror-sourcehut:
127
140
timeout-minutes: 20
128
141
runs-on: ${{ inputs.runs-on }}
129
142
if: vars.SOURCEHUT_MIRROR_ENABLED == 'true'
143
+
# See mirror-gitlab: the `secrets` context is not valid in step `if:`;
144
+
# hoist to job-level `env` and gate steps on `env.SOURCEHUT_KEY`.
- name: Skipped (SOURCEHUT_SSH_KEY not configured)
145
-
if: ${{ secrets.SOURCEHUT_SSH_KEY == '' }}
162
+
if: ${{ env.SOURCEHUT_KEY == '' }}
146
163
run: |
147
164
echo "::notice::SOURCEHUT_MIRROR_ENABLED=true but secrets.SOURCEHUT_SSH_KEY is empty. Skipping SourceHut mirror. Configure the SOURCEHUT_SSH_KEY org/repo secret to enable."
148
165
149
166
mirror-disroot:
150
167
timeout-minutes: 20
151
168
runs-on: ${{ inputs.runs-on }}
152
169
if: vars.DISROOT_MIRROR_ENABLED == 'true'
170
+
# See mirror-gitlab: the `secrets` context is not valid in step `if:`;
171
+
# hoist to job-level `env` and gate steps on `env.DISROOT_KEY`.
echo "::notice::DISROOT_MIRROR_ENABLED=true but secrets.DISROOT_SSH_KEY is empty. Skipping Disroot mirror. Configure the DISROOT_SSH_KEY org/repo secret to enable."
171
192
172
193
mirror-gitea:
173
194
timeout-minutes: 20
174
195
runs-on: ${{ inputs.runs-on }}
175
196
if: vars.GITEA_MIRROR_ENABLED == 'true'
197
+
# See mirror-gitlab: the `secrets` context is not valid in step `if:`;
198
+
# hoist to job-level `env` and gate steps on `env.GITEA_KEY`.
echo "::notice::GITEA_MIRROR_ENABLED=true but secrets.GITEA_SSH_KEY is empty. Skipping Gitea mirror. Configure the GITEA_SSH_KEY org/repo secret to enable."
0 commit comments