Skip to content

Commit 660cf99

Browse files
authored
fix: use -W flag for minisign password input from stdin (#20)
- Add -W flag to all minisign commands to read password from stdin - Remove MINISIGN_PASS environment variable approach that doesn't work - Pipe password directly to minisign for all signing operations
1 parent 34a758b commit 660cf99

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,8 @@ jobs:
8585
- name: Sign package with minisign
8686
run: |
8787
if [ ! -f minisign.key.skip ]; then
88-
# Export password as environment variable for minisign
89-
export MINISIGN_PASS="${{ secrets.MINISIGN_PASSPHRASE }}"
90-
minisign -Sm "$PACKAGE_FILE" -s minisign.key -t "create-claude npm package v$VERSION - $(date -u +%Y-%m-%d)"
88+
# Use -W flag to read password from stdin
89+
echo "${{ secrets.MINISIGN_PASSPHRASE }}" | minisign -Sm "$PACKAGE_FILE" -s minisign.key -W -t "create-claude npm package v$VERSION - $(date -u +%Y-%m-%d)"
9190
echo "✓ Successfully signed package with minisign"
9291
else
9392
echo "::warning::Skipping minisign signature generation"
@@ -132,23 +131,20 @@ jobs:
132131
133132
- name: Sign all SBOMs and attestations
134133
run: |
135-
# Export password as environment variable for minisign
136-
export MINISIGN_PASS="${{ secrets.MINISIGN_PASSPHRASE }}"
137-
138134
# Sign all SBOM files with both minisign and GPG (if keys available)
139135
for sbom in create-claude-$VERSION.sbom.* create-claude-$VERSION.ms-spdx.json; do
140136
if [ -f "$sbom" ]; then
141137
echo "Signing $sbom"
142138
if [ ! -f minisign.key.skip ]; then
143-
minisign -Sm "$sbom" -s minisign.key -t "SBOM for create-claude v$VERSION"
139+
echo "${{ secrets.MINISIGN_PASSPHRASE }}" | minisign -Sm "$sbom" -s minisign.key -W -t "SBOM for create-claude v$VERSION"
144140
fi
145141
gpg --armor --detach-sign --output "$sbom.asc" "$sbom"
146142
fi
147143
done
148144
149145
# Find and sign any GitHub attestation files
150146
if [ ! -f minisign.key.skip ]; then
151-
find . -name "*.intoto.jsonl" -exec minisign -Sm {} -s minisign.key -t "SLSA Attestation for create-claude v$VERSION" \;
147+
find . -name "*.intoto.jsonl" -exec sh -c 'echo "${{ secrets.MINISIGN_PASSPHRASE }}" | minisign -Sm "$1" -s minisign.key -W -t "SLSA Attestation for create-claude v$VERSION"' _ {} \;
152148
fi
153149
find . -name "*.intoto.jsonl" -exec gpg --armor --detach-sign --output {}.asc {} \;
154150

0 commit comments

Comments
 (0)