Skip to content

Commit 3482eec

Browse files
tylergraydevTyler Gray
andauthored
fix(ci): skip updater signing on PR builds from forks/Dependabot (#203)
* fix(ci): skip updater signing on PR builds PRs from forks (prefrontalsys/*) and Dependabot can't read repo secrets, so ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} evaluates to "" and tauri-action fails with "Missing comment in secret key" after an otherwise-successful Rust build. The old comment claimed signing only ran on pushes to main, but the gate was never implemented. Split the Build Tauri app step by github.event_name: - pull_request: no signing env vars, --bundles omits the updater target (per-platform bundle list preserves the existing upload-artifacts if-no-files-found: error contract). - push: unchanged behavior -- signed artifacts with the macOS x86_64 app+updater special case intact. Release workflow untouched since it only runs on tag push. * fix(ci): override createUpdaterArtifacts=false on PR builds Previous attempt gated the signing env vars behind github.event_name, but tauri build still fails with "A public key has been found, but no private key" because pubkey in tauri.conf.json triggers the signing check independent of --bundles. Override bundle.createUpdaterArtifacts to false via inline --config JSON for PR builds. Also simplified the per-platform --bundles list -- unnecessary now that createUpdaterArtifacts is off. Kept the macOS x86_64 "--bundles app" quirk to mirror the push step's "--bundles app,updater". --------- Co-authored-by: Tyler Gray <tylerg@emergentsoftware.net>
1 parent 0927b9d commit 3482eec

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,23 @@ jobs:
112112
- name: Install frontend dependencies
113113
run: npm ci
114114

115-
- name: Build Tauri app
115+
# Disable updater artifacts on PR builds: fork/Dependabot PRs can't read secrets, and tauri refuses to build when pubkey is set in config but no private key is available.
116+
- name: Build Tauri app (PR — updater disabled)
117+
if: github.event_name == 'pull_request'
118+
uses: tauri-apps/tauri-action@v0
119+
env:
120+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121+
with:
122+
args: >-
123+
--target ${{ matrix.target }}
124+
--config {"bundle":{"createUpdaterArtifacts":false}}
125+
${{ matrix.target == 'x86_64-apple-darwin' && '--bundles app' || '' }}
126+
127+
- name: Build Tauri app (push to main — signed)
128+
if: github.event_name == 'push'
116129
uses: tauri-apps/tauri-action@v0
117130
env:
118131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119-
# Only use signing keys on push to main (PRs don't need signed artifacts)
120132
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
121133
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
122134
with:

0 commit comments

Comments
 (0)