Skip to content

Commit 4f7f1c7

Browse files
authored
fix(docs): pass secrets to the reusable documentation workflow (#219)
* fix(docs): pass secrets to the reusable documentation workflow A called workflow receives no secrets from its caller unless they are passed explicitly or inherited. Without `secrets: inherit` the callee sees an empty `secrets.CF_API_TOKEN`, its "Publish to the Cloudflare Worker" step skips itself on its own guard, and the run finishes green having written only gh-pages — which nothing serves. The live docs site never changes and no check goes red to say so. Measured on planninq run 32715324775: all three jobs green, GitHub Pages deploy success, Worker publish skipped, warn step reporting the Worker was not updated. * fix(docs): map the Cloudflare secrets explicitly instead of inheriting all `secrets: inherit` handed the reusable documentation workflow every secret this repo holds — the Nextcloud signing cert and key, the appstore token, the deploy keys — for the sake of two Cloudflare values. It also would not have worked. The org secrets are CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID and `inherit` passes secrets under their original names, while the callee reads CF_API_TOKEN / CF_ACCOUNT_ID — so the publish step would still have skipped itself and the run would still have gone green over an unchanged live site. Maps the two names explicitly instead, so nothing else crosses the boundary. Depends on ConductionNL/.github#568, which declares both as optional secrets on the callee: an explicit mapping only compiles for names the callee declares.
1 parent 3e356ee commit 4f7f1c7

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎.github/workflows/documentation.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,25 @@ on:
99
jobs:
1010
deploy:
1111
uses: ConductionNL/.github/.github/workflows/documentation.yml@main
12+
# A reusable workflow receives NO secrets by default. Without this block
13+
# `secrets.CF_API_TOKEN` is empty inside the callee, its "Publish to the
14+
# Cloudflare Worker" step skips itself on its own guard, and the run
15+
# finishes GREEN having written only gh-pages — which nothing serves. The
16+
# live site never changes and no check goes red to say so.
17+
#
18+
# Mapped explicitly rather than `secrets: inherit`, because `inherit`
19+
# hands the callee EVERY secret this repo holds — signing cert and key,
20+
# appstore token, deploy keys — for the sake of two Cloudflare values.
21+
# This way only those two cross the boundary.
22+
#
23+
# The names also differ on each side (org `CLOUDFLARE_*`, callee `CF_*`),
24+
# and `inherit` passes secrets under their ORIGINAL names — so it would
25+
# have left `CF_API_TOKEN` empty even setting the exposure aside. Needs
26+
# ConductionNL/.github#568: a mapping only compiles for secrets the callee
27+
# declares.
28+
secrets:
29+
CF_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
30+
CF_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
1231
with:
1332
cname: versioniq.conduction.nl
1433

0 commit comments

Comments
 (0)