File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -204,21 +204,21 @@ jobs:
204204 echo "VERSION=${VERSION}" >> $GITHUB_ENV
205205
206206 # Use verified CRX private key from GitHub Secrets with fallback
207- # Check if secret exists using a safe method
208- if [[ -z "${{ secrets.CHROME_CRX_PRIVATE_KEY }}" ]]; then
209- echo "⚠️ CHROME_CRX_PRIVATE_KEY secret not found"
207+ # Try to write the secret directly to file - if it doesn't exist, this will create an empty file
208+ cat > chrome-extension.pem << 'EOF'
209+ ${{ secrets.CHROME_CRX_PRIVATE_KEY }}
210+ EOF
211+
212+ # Check if the file has content (safer than checking the secret directly)
213+ if [[ ! -s chrome-extension.pem ]]; then
214+ echo "⚠️ CHROME_CRX_PRIVATE_KEY secret not found or empty"
210215 echo "🔄 Falling back to generated key for testing"
211216 echo "⚠️ Chrome Web Store will reject this - please add verified key as GitHub Secret"
212217
213218 # Generate temporary key for testing
214219 openssl genrsa -out chrome-extension.pem 2048
215220 echo "🔐 Generated temporary CRX private key for testing"
216221 else
217- # Write private key from GitHub Secrets to temporary file using heredoc
218- # This safely handles multi-line PEM content without bash interpretation
219- cat > chrome-extension.pem << 'EOF'
220- ${{ secrets.CHROME_CRX_PRIVATE_KEY }}
221- EOF
222222 echo "🔐 Using verified CRX private key from GitHub Secrets"
223223 chmod 600 chrome-extension.pem
224224
You can’t perform that action at this time.
0 commit comments