Skip to content

Commit 646acb1

Browse files
authored
Merge pull request #84 from VariableThe/fix/ci-signing-key-sanitization
fix(ci): sanitize release signing key before tauri build
2 parents 825bd54 + b778246 commit 646acb1

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,22 @@ jobs:
5656

5757
- run: npm ci
5858

59+
- name: Sanitize Tauri Signing Key
60+
shell: bash
61+
env:
62+
RAW_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
63+
run: |
64+
CLEAN_KEY=$(echo -n "$RAW_KEY" | python3 -c "import sys, urllib.parse; k = sys.stdin.read().strip(); k = k[:-1] if k.endswith('%') else k; k = urllib.parse.unquote(k) if '%' in k else k; print(k, end='')")
65+
echo "::add-mask::$CLEAN_KEY"
66+
echo "TAURI_SIGNING_PRIVATE_KEY<<EOF" >> $GITHUB_ENV
67+
echo "$CLEAN_KEY" >> $GITHUB_ENV
68+
echo "EOF" >> $GITHUB_ENV
69+
5970
- name: Build and Upload Tauri App
6071
uses: tauri-apps/tauri-action@fce9c6108b31ea247710505d3aaaa893ee6768d4 # v0
6172
env:
6273
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63-
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
74+
TAURI_SIGNING_PRIVATE_KEY: ${{ env.TAURI_SIGNING_PRIVATE_KEY }}
6475
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
6576
with:
6677
tagName: ${{ needs.create-tag.outputs.new_tag }}

AUDIT_LOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
This log tracks all significant changes, updates, and versions in the PaperCache project.
44

5+
## 2026-06-29 (CI Signing Key Sanitization Fix)
6+
**Change:** fix(ci): sanitize `TAURI_SIGNING_PRIVATE_KEY` before `tauri build` to strip trailing terminal prompt artifacts (`%`) or URL encoding
7+
8+
**Details/Why:**
9+
1. **Secret Key Sanitization**: When copying private keys from macOS Zsh terminals without trailing newlines (`cat ~/.tauri/papercache.key`), Zsh appends an inverted `%` symbol at EOF. When pasted into GitHub repository secrets, this trailing `%` causes base64 decoding errors (`Invalid symbol 37, offset 348`). Added a pre-build workflow step in `.github/workflows/release.yml` to automatically strip trailing `%` symbols and decode URL encoding before running `tauri-action`.
10+
11+
**Files changed:** `.github/workflows/release.yml`, `CHANGELOG.md`, `AUDIT_LOG.md`.
12+
13+
---
14+
515
## 2026-06-29 (v0.5.7 Release: Auto-Update Overhaul, On-Demand Update Checks, and Build Fixes)
616
**Change:** chore(release): bump version to 0.5.7; feat(updater): overhaul auto-update flow with real-time UI feedback ("Checking…"), toast notification with "Restart Now" button, and manifest configuration; fix(api): update `onEvent` listener helper to forward payloads to callbacks fixing TS2345 strict build error
717

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
- **Release Signing Key Sanitization**: Added automated workflow sanitization to strip trailing terminal prompt EOF symbols (`%`) or URL-encoding artifacts from `TAURI_SIGNING_PRIVATE_KEY` during CI builds.
12+
1013
## [v0.5.7] - 2026-06-29
1114

1215
### Added

0 commit comments

Comments
 (0)