File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -27,18 +27,29 @@ jobs:
2727 - name : Import GPG key
2828 run : |
2929 # Write key to file to handle multiline content properly
30- echo "${{ secrets.OSSRH_GPG_SECRET_KEY }}" > "$RUNNER_TEMP/private-key.asc"
30+ cat <<'EOF' > "$RUNNER_TEMP/private-key.asc"
31+ ${{ secrets.OSSRH_GPG_SECRET_KEY }}
32+ EOF
3133
32- # Show what we're trying to import (first/last lines only for security)
33- echo "First line of key file:"
34- head -n 1 "$RUNNER_TEMP/private-key.asc"
35- echo "Last line of key file:"
36- tail -n 1 "$RUNNER_TEMP/private-key.asc"
34+ # Check file info (size won't be masked)
35+ echo "Key file size: $(wc -c < "$RUNNER_TEMP/private-key.asc") bytes"
36+ echo "Key file lines: $(wc -l < "$RUNNER_TEMP/private-key.asc") lines"
37+
38+ # Check if it looks like a PGP key
39+ if grep -q "BEGIN PGP PRIVATE KEY BLOCK" "$RUNNER_TEMP/private-key.asc"; then
40+ echo "✓ File contains PGP key header"
41+ else
42+ echo "✗ File does NOT contain PGP key header!"
43+ echo "Your OSSRH_GPG_SECRET_KEY secret is not in the correct format."
44+ echo "It should start with: -----BEGIN PGP PRIVATE KEY BLOCK-----"
45+ exit 1
46+ fi
3747
3848 # Import the key
3949 gpg --batch --import "$RUNNER_TEMP/private-key.asc"
4050
4151 # List imported keys
52+ echo "Successfully imported keys:"
4253 gpg --list-secret-keys --keyid-format LONG
4354
4455 # Clean up
You can’t perform that action at this time.
0 commit comments