This document explains how to set up SSH commit signing for the GitHub Actions release workflow. SSH signing is newer and simpler than GPG signing, with full GitHub support.
For professional projects, create a dedicated bot account rather than using your personal account:
photostructure-botphotostructure-bot@users.noreply.github.comhttps://github.com/photostructure/node-sqliteGenerate an Ed25519 SSH key specifically for commit signing:
# Generate the key pair
ssh-keygen -t ed25519 -f ~/.ssh/photostructure-bot-signing -N "" -C "photostructure-bot"
# Display the public key (you'll need this for GitHub)
cat ~/.ssh/photostructure-bot-signing.pub
Important: Add the key to the bot account, not your personal account.
photostructure-botnode-sqlite Release Signing Key~/.ssh/photostructure-bot-signing.pubAdd the private key to your repository secrets:
# Copy private key to clipboard (macOS)
cat ~/.ssh/photostructure-bot-signing | pbcopy
# Copy private key to clipboard (Linux with xclip)
cat ~/.ssh/photostructure-bot-signing | xclip -selection clipboard
# Copy private key to clipboard (Windows with clip)
cat ~/.ssh/photostructure-bot-signing | clip
| Secret Name | Value |
|---|---|
SSH_SIGNING_KEY |
Paste the private key content |
GIT_USER_NAME |
photostructure-bot |
GIT_USER_EMAIL |
bot@photostructure.com |
NPM_TOKEN |
Your npm authentication token |
The SSH signing setup uses the external Git SSH Signing Action, which:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: photostructure/git-ssh-signing-action@v1
with:
ssh-signing-key: ${{ secrets.SSH_SIGNING_KEY }}
git-user-name: ${{ secrets.GIT_USER_NAME }}
git-user-email: ${{ secrets.GIT_USER_EMAIL }}
# Your build and release steps here
- run: npm ci
- run: npm version patch
- run: git push origin main --follow-tags
Test your setup before using it in production:
# Run the release workflow with "current" version (dry run)
gh workflow run "Build & Release" -f version=current
# Check the workflow status
gh run list --workflow="Build & Release"
Before triggering a release:
| Feature | SSH Signing | GPG Signing |
|---|---|---|
| Setup complexity | Simple | Complex |
| Key generation | One command | Multiple steps |
| Passphrase handling | Not required | Required |
| Wrapper scripts | Not needed | Required |
| GitHub verification | ✓ Supported | ✓ Supported |
| Maintenance | Minimal | Higher |
After setting up, securely remove local key copies:
# Remove the local key files
rm ~/.ssh/photostructure-bot-signing
rm ~/.ssh/photostructure-bot-signing.pub
# Or move to secure backup location
mv ~/.ssh/photostructure-bot-signing* ~/secure-backup/
To create a new release:
current: Use the version in package.json (useful for re-releases)patch: Increment patch version (e.g., 1.0.0 → 1.0.1)minor: Increment minor version (e.g., 1.0.0 → 1.1.0)major: Increment major version (e.g., 1.0.0 → 2.0.0)The workflow will:
contents: write permission