@@ -19,8 +19,8 @@ This skill guides you through the complete commit process for the Torrust Tracke
1919# 2. Stage changes
2020git add < files>
2121
22- # 3. Commit with conventional format
23- git commit -m " {type}: [#{issue}] {description}"
22+ # 3. Commit with conventional format and GPG signature (MANDATORY)
23+ git commit -S - m " {type}: [#{issue}] {description}"
2424```
2525
2626## Conventional Commit Format
@@ -60,6 +60,16 @@ When working on a branch with an issue number, include it in your commit message
6060| ` ci ` | CI/CD related changes | ` ci: [#23] add workflow for testing provisioning ` |
6161| ` perf ` | Performance improvements | ` perf: [#52] optimize container startup time ` |
6262
63+ ## GPG Commit Signing (MANDATORY)
64+
65+ ** All commits must be GPG signed.** Use the ` -S ` flag:
66+
67+ ``` bash
68+ git commit -S -m " your commit message"
69+ ```
70+
71+ Ensure GPG is configured (see Troubleshooting section if signing fails).
72+
6373## Pre-commit Verification (MANDATORY)
6474
6575** Before committing any changes** , you ** MUST** run:
@@ -207,15 +217,30 @@ vim src/main.rs
207217# 4. Stage changes
208218git add src/main.rs
209219
210- # 5. Commit with conventional format
211- git commit -m " feat: [#42] add new CLI command"
220+ # 5. Commit with conventional format and GPG signature (MANDATORY)
221+ git commit -S - m " feat: [#42] add new CLI command"
212222
213223# 6. Push to remote
214224git push origin 42-add-new-cli-command
215225```
216226
217227## Troubleshooting
218228
229+ ### GPG Signing Fails
230+
231+ ** Problem** : ` git commit -S ` fails with "gpg failed to sign the data"
232+
233+ ** Solution** :
234+
235+ 1 . Verify GPG is installed: ` gpg --version `
236+ 2 . List your GPG keys: ` gpg --list-keys `
237+ 3 . If no keys exist, create one: ` gpg --gen-key `
238+ 4 . Configure Git to use your GPG key: ` git config --global user.signingkey <YOUR_KEY_ID> `
239+ 5 . Test signing: ` echo "test" | gpg --clearsign `
240+ 6 . Retry commit: ` git commit -S -m "your message" `
241+
242+ If still failing, check that your GPG agent is running and has proper pinentry configured.
243+
219244### Pre-commit Script Fails
220245
221246** Problem** : One or more checks fail in ` ./scripts/pre-commit.sh `
@@ -261,8 +286,9 @@ Note: This is only supported in local environments with proper LXD networking an
261286
262287## Key Reminders
263288
264- 1 . ** Always run ` ./scripts/pre-commit.sh ` before committing** - This is non-negotiable
265- 2 . ** Use issue numbers consistently** - Follow the ` [#{issue}] ` format
266- 3 . ** Be careful with hashtags** - Only use ` #NUMBER ` when referencing issues
267- 4 . ** Keep commits atomic** - One logical change per commit
268- 5 . ** Write descriptive messages** - Future you will thank present you
289+ 1 . ** Always sign commits with ` -S ` ** - GPG signing is mandatory for audit trail
290+ 2 . ** Always run ` ./scripts/pre-commit.sh ` before committing** - This is non-negotiable
291+ 3 . ** Use issue numbers consistently** - Follow the ` [#{issue}] ` format
292+ 4 . ** Be careful with hashtags** - Only use ` #NUMBER ` when referencing issues
293+ 5 . ** Keep commits atomic** - One logical change per commit
294+ 6 . ** Write descriptive messages** - Future you will thank present you
0 commit comments