Skip to content

Commit b02fba5

Browse files
committed
ci(release): move ed25519 signing gate from secrets.X to env.X
GitHub Actions evaluates `if:` at workflow-parse time and doesn't expose the `secrets` context there, so `if: secrets.FOO != ''` is an invalid workflow. Use the standard pattern: inject the secret into `env:` (which IS available at runtime), then gate on `env.X != ''`. Also swap `echo` for `printf '%s'` so trailing newlines don't corrupt the key bytes on read.
1 parent 45632e5 commit b02fba5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,11 @@ jobs:
164164
EOF
165165
cat manifest.json
166166
- name: Sign manifest (ed25519)
167-
if: ${{ secrets.FORGE_RELEASE_ED25519_PRIV != '' }}
167+
env:
168+
ED25519_KEY: ${{ secrets.FORGE_RELEASE_ED25519_PRIV }}
169+
if: env.ED25519_KEY != ''
168170
run: |
169-
echo "${{ secrets.FORGE_RELEASE_ED25519_PRIV }}" > /tmp/ed25519.key
171+
printf '%s' "$ED25519_KEY" > /tmp/ed25519.key
170172
openssl pkeyutl -sign -inkey /tmp/ed25519.key -rawin -in manifest.json -out manifest.sig.bin
171173
base64 -w0 manifest.sig.bin > manifest.sig
172174
- uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)