chore: update sign action

actions/checkout@v4 to actions/checkout@v5
configure GPG commit signing

Signed-off-by: nopeitsnothing <no@anonymousplanet.net>
This commit is contained in:
nopeitsnothing
2026-06-27 19:29:54 -04:00
parent 8b4542f4d9
commit 5a15f2615a
+12 -10
View File
@@ -15,6 +15,7 @@ on:
permissions: permissions:
actions: read actions: read
contents: write contents: write
pull-requests: write
jobs: jobs:
sign: sign:
@@ -28,7 +29,7 @@ jobs:
steps: steps:
- name: 🛠️ Checkout (for pgp/ key reference only) - name: 🛠️ Checkout (for pgp/ key reference only)
uses: actions/checkout@v4 uses: actions/checkout@v5
with: with:
sparse-checkout: pgp sparse-checkout: pgp
@@ -43,7 +44,6 @@ jobs:
- name: 📋 List downloaded files - name: 📋 List downloaded files
run: ls -lh export/ run: ls -lh export/
# Hash - extensions match export/ conventions: .sha256, .b2sum
- name: "#️⃣ Hash PDFs" - name: "#️⃣ Hash PDFs"
id: hashes id: hashes
run: | run: |
@@ -110,7 +110,7 @@ jobs:
# Commit export/ back to main # Commit export/ back to main
- name: 📦 Checkout full repo for commit - name: 📦 Checkout full repo for commit
uses: actions/checkout@v4 uses: actions/checkout@v5
with: with:
ref: main ref: main
fetch-depth: 0 fetch-depth: 0
@@ -119,14 +119,13 @@ jobs:
- name: 📂 Copy export files into repo - name: 📂 Copy export files into repo
run: cp -v export/* repo/export/ run: cp -v export/* repo/export/
- name: 🔏 Configure SSH commit signing - name: 🔏 Configure GPG commit signing
run: | run: |
mkdir -p ~/.ssh mkdir -p ~/.gnupg
echo "${{ secrets.ACTIONS_SSH_SIGNING_KEY }}" > ~/.ssh/signing_key echo "$GPG_PRIVATE_KEY" | gpg --batch --quiet --import > /dev/null 2>&1 || true
chmod 600 ~/.ssh/signing_key
git config --global gpg.format ssh
git config --global user.signingKey ~/.ssh/signing_key
git config --global commit.gpgSign true git config --global commit.gpgSign true
git config --global gpg.program gpg
git config --global gpg.exectimeout 180
git config --global user.name "github-actions[bot]" git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.email "github-actions[bot]@users.noreply.github.com"
@@ -138,7 +137,10 @@ jobs:
if git diff --cached --quiet; then if git diff --cached --quiet; then
echo "Nothing to commit — export/ is already up to date." echo "Nothing to commit — export/ is already up to date."
else else
export GNUPGHOME=~/.gnupg
gpg --list-secret-keys --with-colons > /dev/null 2>&1 || true
git commit -S -m "chore(export): update PDFs, hashes and signatures [skip ci]" git commit -S -m "chore(export): update PDFs, hashes and signatures [skip ci]"
git config --global credential.helper 'cache --timeout=600'
git push origin main git push origin main
fi fi
@@ -183,7 +185,7 @@ jobs:
steps: steps:
- name: 🛠️ Checkout scripts and public key - name: 🛠️ Checkout scripts and public key
uses: actions/checkout@v4 uses: actions/checkout@v5
with: with:
sparse-checkout: | sparse-checkout: |
scripts/verify_pdf.py scripts/verify_pdf.py