File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 mkdir -p ~/.gnupg
3131 chmod 700 ~/.gnupg
3232 echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf
33- echo "${{ secrets.HELM_RSA_PRIVATE_KEY }}" | base64 -d | gpg --batch --import
33+
34+ # Debug: Check if the secret is non-empty
35+ if [ -z "${{ secrets.HELM_RSA_PRIVATE_KEY }}" ]; then
36+ echo "❌ HELM_RSA_PRIVATE_KEY is empty!"
37+ exit 1
38+ fi
39+
40+ # Decode and import
41+ echo "${{ secrets.HELM_RSA_PRIVATE_KEY }}" | base64 -di > private.key || {
42+ echo "❌ Base64 decoding failed";
43+ exit 1;
44+ }
45+ gpg --batch --import private.key || {
46+ echo "❌ GPG import failed";
47+ gpg --list-keys;
48+ exit 1;
49+ }
50+
51+ # Verify
52+ gpg --list-secret-keys --keyid-format LONG
53+
54+ # Export for Helm
3455 echo "${{ secrets.HELM_RSA_PASSPHRASE }}" | gpg --batch --passphrase-fd 0 --export-secret-keys > ~/.gnupg/secring.gpg
3556
3657 - name : Package and Sign Charts
5374 echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf
5475
5576 # Import the RSA public key for verification
56- echo "${{ secrets.HELM_RSA_PRIVATE_KEY }}" | base64 -d | gpg --batch --import
77+ echo "${{ secrets.HELM_RSA_PRIVATE_KEY }}" | tr -d ' \n\r' | base64 -d 2>/dev/null | gpg --batch --import
5778
5879 # Create the public keyring that helm verify expects
5980 gpg --batch --export > ~/.gnupg/pubring.gpg
You can’t perform that action at this time.
0 commit comments